//	--------------------------------------------------------------------
//	Copyright(C) 2006,2007 Zhao Yukun. All rights reserved.
//	This file is a part of the Xeres system.
//	Xeres 2007
//	Contact : xeres.engine@gmail.com
//	$(reservedInfo)
//	$(reservedDeclaration)
//	--------------------------------------------------------------------
///	@file	<import_dx10.cpp>
///	@path	~/src/graphics/dx10/
///	@date	2007/10/18
///	@desc	DX10 API dynamic load.

#include "config/config.h"

#include "graphics/dx10/import_dx10.h"
#include "graphics/dx9/import_dx9.h"

#define	_DYNAMIC_LOAD_DX10		1

#if (!_DYNAMIC_LOAD_DX10)
//#pragma comment( linker , "/defaultlib:d3d10.lib" )
#ifdef _DEBUG
//#pragma comment( linker , "/defaultlib:d3dx10d.lib" )
#else
//#pragma comment( linker , "/defaultlib:d3dx10.lib" )
#endif
#endif

namespace xeres {

	namespace dx10
	{
		namespace fn
		{
			/// \name DirectX 3D 10
			//@{
			static HMODULE s_hDirect3D10Module = NULL;
			static HMODULE s_hDXGIModule = NULL;

			// Create a Direct3D 10.0 device that represents the display adapter.
			HRESULT (WINAPI *D3D10CreateDevice)(
				IDXGIAdapter *pAdapter,
				D3D10_DRIVER_TYPE DriverType,
				HMODULE Software,
				UINT Flags,
				UINT SDKVersion,
				ID3D10Device **ppDevice ) = NULL;

			// Create a buffer.
			HRESULT (WINAPI *D3D10CreateBlob)(
				SIZE_T NumBytes,
				LPD3D10BLOB *ppBuffer ) = NULL;

			// Create a Direct3D 10.0 device and a swap chain.
			HRESULT (WINAPI *D3D10CreateDeviceAndSwapChain)(
				IDXGIAdapter *pAdapter,
				D3D10_DRIVER_TYPE DriverType,
				HMODULE Software,
				UINT Flags,
				UINT SDKVersion,
				DXGI_SWAP_CHAIN_DESC *pSwapChainDesc,
				IDXGISwapChain **ppSwapChain,
				ID3D10Device **ppDevice ) = NULL;

			HRESULT (WINAPI *CreateDXGIFactory)(
				REFIID riid,
				void **ppFactory );

			HRESULT (WINAPI *D3D10ReflectShader)(CONST void* pShaderBytecode, SIZE_T BytecodeLength, ID3D10ShaderReflection **ppReflector);

			HRESULT (WINAPI *D3D10CompileShader)(LPCSTR pSrcData, SIZE_T SrcDataLen, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, 
				LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs) = NULL;

			HRESULT (WINAPI *D3D10DisassembleShader)(CONST void *pShader, SIZE_T BytecodeLength, BOOL EnableColorCode, LPCSTR pComments, ID3D10Blob** ppDisassembly) = NULL;

			LPCSTR (WINAPI *D3D10GetPixelShaderProfile)(ID3D10Device *pDevice) = NULL;
			LPCSTR (WINAPI *D3D10GetVertexShaderProfile)(ID3D10Device *pDevice) = NULL;
			LPCSTR (WINAPI *D3D10GetGeometryShaderProfile)(ID3D10Device *pDevice) = NULL;

			HRESULT (WINAPI *D3D10PreprocessShader)(LPCSTR pSrcData, SIZE_T SrcDataSize, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, 
				LPD3D10INCLUDE pInclude, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs) = NULL;

			HRESULT (WINAPI *D3D10GetInputSignatureBlob)(CONST void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10Blob **ppSignatureBlob) = NULL;
			HRESULT (WINAPI *D3D10GetOutputSignatureBlob)(CONST void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10Blob **ppSignatureBlob) = NULL;
			HRESULT (WINAPI *D3D10GetInputAndOutputSignatureBlob)(CONST void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10Blob **ppSignatureBlob) = NULL;

			HRESULT (WINAPI *D3D10GetShaderDebugInfo)(CONST void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10Blob** ppDebugInfo) = NULL;

			HRESULT (WINAPI *D3D10StateBlockMaskUnion)(D3D10_STATE_BLOCK_MASK *pA, D3D10_STATE_BLOCK_MASK *pB, D3D10_STATE_BLOCK_MASK *pResult) = NULL;
			HRESULT (WINAPI *D3D10StateBlockMaskIntersect)(D3D10_STATE_BLOCK_MASK *pA, D3D10_STATE_BLOCK_MASK *pB, D3D10_STATE_BLOCK_MASK *pResult) = NULL;
			HRESULT (WINAPI *D3D10StateBlockMaskDifference)(D3D10_STATE_BLOCK_MASK *pA, D3D10_STATE_BLOCK_MASK *pB, D3D10_STATE_BLOCK_MASK *pResult) = NULL;
			HRESULT (WINAPI *D3D10StateBlockMaskEnableCapture)(D3D10_STATE_BLOCK_MASK *pMask, D3D10_DEVICE_STATE_TYPES StateType, UINT RangeStart, UINT RangeLength) = NULL;
			HRESULT (WINAPI *D3D10StateBlockMaskDisableCapture)(D3D10_STATE_BLOCK_MASK *pMask, D3D10_DEVICE_STATE_TYPES StateType, UINT RangeStart, UINT RangeLength) = NULL;
			HRESULT (WINAPI *D3D10StateBlockMaskEnableAll)(D3D10_STATE_BLOCK_MASK *pMask) = NULL;
			HRESULT (WINAPI *D3D10StateBlockMaskDisableAll)(D3D10_STATE_BLOCK_MASK *pMask) = NULL;
			BOOL    (WINAPI *D3D10StateBlockMaskGetSetting)(D3D10_STATE_BLOCK_MASK *pMask, D3D10_DEVICE_STATE_TYPES StateType, UINT Entry) = NULL;

			HRESULT (WINAPI *D3D10CreateStateBlock)(ID3D10Device *pDevice, D3D10_STATE_BLOCK_MASK *pStateBlockMask, ID3D10StateBlock **ppStateBlock) = NULL;

			HRESULT (WINAPI *D3D10CompileEffectFromMemory)(void *pData, SIZE_T DataLength, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines, 
				ID3D10Include *pInclude, UINT HLSLFlags, UINT FXFlags, 
				ID3D10Blob **ppCompiledEffect, ID3D10Blob **ppErrors) = NULL;

			HRESULT (WINAPI *D3D10CreateEffectFromMemory)(void *pData, SIZE_T DataLength, UINT FXFlags, ID3D10Device *pDevice, 
				ID3D10EffectPool *pEffectPool, ID3D10Effect **ppEffect) = NULL;

			HRESULT (WINAPI *D3D10CreateEffectPoolFromMemory)(void *pData, SIZE_T DataLength, UINT FXFlags, ID3D10Device *pDevice,
				ID3D10EffectPool **ppEffectPool) = NULL;

			HRESULT (WINAPI *D3D10DisassembleEffect)(ID3D10Effect *pEffect, BOOL EnableColorCode, ID3D10Blob **ppDisassembly) = NULL;


			//@}

			/// \name DirectX 3D X 10
			//@{
			static HMODULE s_hDirect3DX10Module = NULL;

			HRESULT (WINAPI *D3DX10CreateDevice)(IDXGIAdapter *pAdapter,
				D3D10_DRIVER_TYPE DriverType,
				HMODULE Software,
				UINT Flags,
				ID3D10Device **ppDevice) = NULL;

			HRESULT (WINAPI *D3DX10CreateDeviceAndSwapChain)(IDXGIAdapter *pAdapter,
				D3D10_DRIVER_TYPE DriverType,
				HMODULE Software,
				UINT Flags,
				DXGI_SWAP_CHAIN_DESC *pSwapChainDesc,
				IDXGISwapChain **ppSwapChain,    
				ID3D10Device **ppDevice) = NULL;

			HRESULT (WINAPI *D3DX10CheckVersion)(UINT D3DSdkVersion, UINT D3DX10SdkVersion) = NULL;

			// Converts an array 32-bit floats to 16-bit floats
			D3DXFLOAT16* (WINAPI *D3DXFloat32To16Array)( D3DXFLOAT16 *pOut, CONST FLOAT *pIn, UINT n ) = NULL;

			// Converts an array 16-bit floats to 32-bit floats
			FLOAT* (WINAPI *D3DXFloat16To32Array)( FLOAT *pOut, CONST D3DXFLOAT16 *pIn, UINT n ) = NULL;

			// Returns the normalized version of a 2D vector.
			D3DXVECTOR2* (WINAPI *D3DXVec2Normalize)( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV ) = NULL;

			// Hermite interpolation between position V1, tangent T1 (when s == 0)
			// and position V2, tangent T2 (when s == 1).
			D3DXVECTOR2* (WINAPI *D3DXVec2Hermite)( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pT1,
				CONST D3DXVECTOR2 *pV2, CONST D3DXVECTOR2 *pT2, FLOAT s ) = NULL;

			// CatmullRom interpolation between V1 (when s == 0) and V2 (when s == 1)
			D3DXVECTOR2* (WINAPI *D3DXVec2CatmullRom)( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV0, CONST D3DXVECTOR2 *pV1,
				CONST D3DXVECTOR2 *pV2, CONST D3DXVECTOR2 *pV3, FLOAT s ) = NULL;

			// Barycentric coordinates.  V1 + f(V2-V1) + g(V3-V1)
			D3DXVECTOR2* (WINAPI *D3DXVec2BaryCentric)( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2,
				CONST D3DXVECTOR2 *pV3, FLOAT f, FLOAT g) = NULL;

			// Transform (x, y, 0, 1) by matrix.
			D3DXVECTOR4* (WINAPI *D3DXVec2Transform)( D3DXVECTOR4 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM ) = NULL;

			// Transform (x, y, 0, 1) by matrix, project result back into w=1.
			D3DXVECTOR2* (WINAPI *D3DXVec2TransformCoord)( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM ) = NULL;

			// Transform (x, y, 0, 0) by matrix.
			D3DXVECTOR2* (WINAPI *D3DXVec2TransformNormal)( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM ) = NULL;

			// Transform Array (x, y, 0, 1) by matrix.
			D3DXVECTOR4* (WINAPI *D3DXVec2TransformArray)
				( D3DXVECTOR4 *pOut, UINT OutStride, CONST D3DXVECTOR2 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n) = NULL;

			// Transform Array (x, y, 0, 1) by matrix, project result back into w=1.
			D3DXVECTOR2* (WINAPI *D3DXVec2TransformCoordArray)
				( D3DXVECTOR2 *pOut, UINT OutStride, CONST D3DXVECTOR2 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n ) = NULL;

			// Transform Array (x, y, 0, 0) by matrix.
			D3DXVECTOR2* (WINAPI *D3DXVec2TransformNormalArray)
				( D3DXVECTOR2 *pOut, UINT OutStride, CONST D3DXVECTOR2 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n ) = NULL;

			// Returns the normalized version of a 3D vector.
			D3DXVECTOR3* (WINAPI *D3DXVec3Normalize)
				( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV ) = NULL;

			// Hermite interpolation between position V1, tangent T1 (when s == 0)
			// and position V2, tangent T2 (when s == 1).
			D3DXVECTOR3* (WINAPI *D3DXVec3Hermite)
				( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pT1,
				CONST D3DXVECTOR3 *pV2, CONST D3DXVECTOR3 *pT2, FLOAT s ) = NULL;

			// CatmullRom interpolation between V1 (when s == 0) and V2 (when s == 1)
			D3DXVECTOR3* (WINAPI *D3DXVec3CatmullRom)
				( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV0, CONST D3DXVECTOR3 *pV1,
				CONST D3DXVECTOR3 *pV2, CONST D3DXVECTOR3 *pV3, FLOAT s ) = NULL;

			// Barycentric coordinates.  V1 + f(V2-V1) + g(V3-V1)
			D3DXVECTOR3* (WINAPI *D3DXVec3BaryCentric)
				( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2,
				CONST D3DXVECTOR3 *pV3, FLOAT f, FLOAT g) = NULL;

			// Transform (x, y, z, 1) by matrix.
			D3DXVECTOR4* (WINAPI *D3DXVec3Transform)
				( D3DXVECTOR4 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM ) = NULL;

			// Transform (x, y, z, 1) by matrix, project result back into w=1.
			D3DXVECTOR3* (WINAPI *D3DXVec3TransformCoord)
				( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM ) = NULL;

			// Transform (x, y, z, 0) by matrix.  If you transforming a normal by a 
			// non-affine matrix, the matrix you pass to this function should be the 
			// transpose of the inverse of the matrix you would use to transform a coord.
			D3DXVECTOR3* (WINAPI *D3DXVec3TransformNormal)
				( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM ) = NULL;


			// Transform Array (x, y, z, 1) by matrix. 
			D3DXVECTOR4* (WINAPI *D3DXVec3TransformArray)
				( D3DXVECTOR4 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n ) = NULL;

			// Transform Array (x, y, z, 1) by matrix, project result back into w=1.
			D3DXVECTOR3* (WINAPI *D3DXVec3TransformCoordArray)
				( D3DXVECTOR3 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n ) = NULL;

			// Transform (x, y, z, 0) by matrix.  If you transforming a normal by a 
			// non-affine matrix, the matrix you pass to this function should be the 
			// transpose of the inverse of the matrix you would use to transform a coord.
			D3DXVECTOR3* (WINAPI *D3DXVec3TransformNormalArray)
				( D3DXVECTOR3 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n ) = NULL;

			// Project vector from object space into screen space
			D3DXVECTOR3* (WINAPI *D3DXVec3Project)
				( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3D10_VIEWPORT *pViewport,
				CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld) = NULL;

			// Project vector from screen space into object space
			D3DXVECTOR3* (WINAPI *D3DXVec3Unproject)
				( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3D10_VIEWPORT *pViewport,
				CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld) = NULL;

			// Project vector Array from object space into screen space
			D3DXVECTOR3* (WINAPI *D3DXVec3ProjectArray)
				( D3DXVECTOR3 *pOut, UINT OutStride,CONST D3DXVECTOR3 *pV, UINT VStride,CONST D3D10_VIEWPORT *pViewport,
				CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld, UINT n) = NULL;

			// Project vector Array from screen space into object space
			D3DXVECTOR3* (WINAPI *D3DXVec3UnprojectArray)
				( D3DXVECTOR3 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3D10_VIEWPORT *pViewport,
				CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld, UINT n) = NULL;

			// Cross-product in 4 dimensions.
			D3DXVECTOR4* (WINAPI *D3DXVec4Cross)( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2,
				CONST D3DXVECTOR4 *pV3) = NULL;

			D3DXVECTOR4* (WINAPI *D3DXVec4Normalize)( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV ) = NULL;

			// Hermite interpolation between position V1, tangent T1 (when s == 0)
			// and position V2, tangent T2 (when s == 1).
			D3DXVECTOR4* (WINAPI *D3DXVec4Hermite)( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pT1,
				CONST D3DXVECTOR4 *pV2, CONST D3DXVECTOR4 *pT2, FLOAT s ) = NULL;

			// CatmullRom interpolation between V1 (when s == 0) and V2 (when s == 1)
			D3DXVECTOR4* (WINAPI *D3DXVec4CatmullRom)( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV0, CONST D3DXVECTOR4 *pV1,
				CONST D3DXVECTOR4 *pV2, CONST D3DXVECTOR4 *pV3, FLOAT s ) = NULL;

			// Barycentric coordinates.  V1 + f(V2-V1) + g(V3-V1)
			D3DXVECTOR4* (WINAPI *D3DXVec4BaryCentric)( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2,
				CONST D3DXVECTOR4 *pV3, FLOAT f, FLOAT g) = NULL;

			// Transform vector by matrix.
			D3DXVECTOR4* (WINAPI *D3DXVec4Transform)( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV, CONST D3DXMATRIX *pM ) = NULL;

			// Transform vector array by matrix.
			D3DXVECTOR4* (WINAPI *D3DXVec4TransformArray)
				( D3DXVECTOR4 *pOut, UINT OutStride, CONST D3DXVECTOR4 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n ) = NULL;

			FLOAT (WINAPI *D3DXMatrixDeterminant)( CONST D3DXMATRIX *pM ) = NULL;

			HRESULT (WINAPI *D3DXMatrixDecompose)( D3DXVECTOR3 *pOutScale, D3DXQUATERNION *pOutRotation, 
				D3DXVECTOR3 *pOutTranslation, CONST D3DXMATRIX *pM ) = NULL;

			D3DXMATRIX* (WINAPI *D3DXMatrixTranspose)( D3DXMATRIX *pOut, CONST D3DXMATRIX *pM ) = NULL;

			// Matrix multiplication.  The result represents the transformation M2
			// followed by the transformation M1.  (Out = M1 * M2)
			D3DXMATRIX* (WINAPI *D3DXMatrixMultiply)( D3DXMATRIX *pOut, CONST D3DXMATRIX *pM1, CONST D3DXMATRIX *pM2 ) = NULL;

			// Matrix multiplication, followed by a transpose. (Out = T(M1 * M2))
			D3DXMATRIX* (WINAPI *D3DXMatrixMultiplyTranspose)( D3DXMATRIX *pOut, CONST D3DXMATRIX *pM1, CONST D3DXMATRIX *pM2 ) = NULL;

			// Calculate inverse of matrix.  Inversion my fail, in which case NULL will
			// be returned.  The determinant of pM is also returned it pfDeterminant
			// is non-NULL.
			D3DXMATRIX* (WINAPI *D3DXMatrixInverse)
				( D3DXMATRIX *pOut, FLOAT *pDeterminant, CONST D3DXMATRIX *pM ) = NULL;

			// Build a matrix which scales by (sx, sy, sz)
			D3DXMATRIX* (WINAPI *D3DXMatrixScaling)
				( D3DXMATRIX *pOut, FLOAT sx, FLOAT sy, FLOAT sz ) = NULL;

			// Build a matrix which translates by (x, y, z)
			D3DXMATRIX* (WINAPI *D3DXMatrixTranslation)
				( D3DXMATRIX *pOut, FLOAT x, FLOAT y, FLOAT z ) = NULL;

			// Build a matrix which rotates around the X axis
			D3DXMATRIX* (WINAPI *D3DXMatrixRotationX)
				( D3DXMATRIX *pOut, FLOAT Angle ) = NULL;

			// Build a matrix which rotates around the Y axis
			D3DXMATRIX* (WINAPI *D3DXMatrixRotationY)
				( D3DXMATRIX *pOut, FLOAT Angle ) = NULL;

			// Build a matrix which rotates around the Z axis
			D3DXMATRIX* (WINAPI *D3DXMatrixRotationZ)
				( D3DXMATRIX *pOut, FLOAT Angle ) = NULL;

			// Build a matrix which rotates around an arbitrary axis
			D3DXMATRIX* (WINAPI *D3DXMatrixRotationAxis)
				( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pV, FLOAT Angle ) = NULL;

			// Build a matrix from a quaternion
			D3DXMATRIX* (WINAPI *D3DXMatrixRotationQuaternion)
				( D3DXMATRIX *pOut, CONST D3DXQUATERNION *pQ) = NULL;

			// Yaw around the Y axis, a pitch around the X axis,
			// and a roll around the Z axis.
			D3DXMATRIX* (WINAPI *D3DXMatrixRotationYawPitchRoll)
				( D3DXMATRIX *pOut, FLOAT Yaw, FLOAT Pitch, FLOAT Roll ) = NULL;

			// Build transformation matrix.  NULL arguments are treated as identity.
			// Mout = Msc-1 * Msr-1 * Ms * Msr * Msc * Mrc-1 * Mr * Mrc * Mt
			D3DXMATRIX* (WINAPI *D3DXMatrixTransformation)
				( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pScalingCenter,
				CONST D3DXQUATERNION *pScalingRotation, CONST D3DXVECTOR3 *pScaling,
				CONST D3DXVECTOR3 *pRotationCenter, CONST D3DXQUATERNION *pRotation,
				CONST D3DXVECTOR3 *pTranslation) = NULL;

			// Build 2D transformation matrix in XY plane.  NULL arguments are treated as identity.
			// Mout = Msc-1 * Msr-1 * Ms * Msr * Msc * Mrc-1 * Mr * Mrc * Mt
			D3DXMATRIX* (WINAPI *D3DXMatrixTransformation2D)
				( D3DXMATRIX *pOut, CONST D3DXVECTOR2* pScalingCenter, 
				FLOAT ScalingRotation, CONST D3DXVECTOR2* pScaling, 
				CONST D3DXVECTOR2* pRotationCenter, FLOAT Rotation, 
				CONST D3DXVECTOR2* pTranslation) = NULL;

			// Build affine transformation matrix.  NULL arguments are treated as identity.
			// Mout = Ms * Mrc-1 * Mr * Mrc * Mt
			D3DXMATRIX* (WINAPI *D3DXMatrixAffineTransformation)
				( D3DXMATRIX *pOut, FLOAT Scaling, CONST D3DXVECTOR3 *pRotationCenter,
				CONST D3DXQUATERNION *pRotation, CONST D3DXVECTOR3 *pTranslation) = NULL;

			// Build 2D affine transformation matrix in XY plane.  NULL arguments are treated as identity.
			// Mout = Ms * Mrc-1 * Mr * Mrc * Mt
			D3DXMATRIX* (WINAPI *D3DXMatrixAffineTransformation2D)
				( D3DXMATRIX *pOut, FLOAT Scaling, CONST D3DXVECTOR2* pRotationCenter, 
				FLOAT Rotation, CONST D3DXVECTOR2* pTranslation) = NULL;

			// Build a lookat matrix. (right-handed)
			D3DXMATRIX* (WINAPI *D3DXMatrixLookAtRH)
				( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pEye, CONST D3DXVECTOR3 *pAt,
				CONST D3DXVECTOR3 *pUp ) = NULL;

			// Build a lookat matrix. (left-handed)
			D3DXMATRIX* (WINAPI *D3DXMatrixLookAtLH)
				( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pEye, CONST D3DXVECTOR3 *pAt,
				CONST D3DXVECTOR3 *pUp ) = NULL;

			// Build a perspective projection matrix. (right-handed)
			D3DXMATRIX* (WINAPI *D3DXMatrixPerspectiveRH)
				( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf ) = NULL;

			// Build a perspective projection matrix. (left-handed)
			D3DXMATRIX* (WINAPI *D3DXMatrixPerspectiveLH)
				( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf ) = NULL;

			// Build a perspective projection matrix. (right-handed)
			D3DXMATRIX* (WINAPI *D3DXMatrixPerspectiveFovRH)
				( D3DXMATRIX *pOut, FLOAT fovy, FLOAT Aspect, FLOAT zn, FLOAT zf ) = NULL;

			// Build a perspective projection matrix. (left-handed)
			D3DXMATRIX* (WINAPI *D3DXMatrixPerspectiveFovLH)
				( D3DXMATRIX *pOut, FLOAT fovy, FLOAT Aspect, FLOAT zn, FLOAT zf ) = NULL;

			// Build a perspective projection matrix. (right-handed)
			D3DXMATRIX* (WINAPI *D3DXMatrixPerspectiveOffCenterRH)
				( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn,
				FLOAT zf ) = NULL;

			// Build a perspective projection matrix. (left-handed)
			D3DXMATRIX* (WINAPI *D3DXMatrixPerspectiveOffCenterLH)
				( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn,
				FLOAT zf ) = NULL;

			// Build an ortho projection matrix. (right-handed)
			D3DXMATRIX* (WINAPI *D3DXMatrixOrthoRH)
				( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf ) = NULL;

			// Build an ortho projection matrix. (left-handed)
			D3DXMATRIX* (WINAPI *D3DXMatrixOrthoLH)
				( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf ) = NULL;

			// Build an ortho projection matrix. (right-handed)
			D3DXMATRIX* (WINAPI *D3DXMatrixOrthoOffCenterRH)
				( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn,
				FLOAT zf ) = NULL;

			// Build an ortho projection matrix. (left-handed)
			D3DXMATRIX* (WINAPI *D3DXMatrixOrthoOffCenterLH)
				( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn,
				FLOAT zf ) = NULL;

			// Build a matrix which flattens geometry into a plane, as if casting
			// a shadow from a light.
			D3DXMATRIX* (WINAPI *D3DXMatrixShadow)
				( D3DXMATRIX *pOut, CONST D3DXVECTOR4 *pLight,
				CONST D3DXPLANE *pPlane ) = NULL;

			// Build a matrix which reflects the coordinate system about a plane
			D3DXMATRIX* (WINAPI *D3DXMatrixReflect)
				( D3DXMATRIX *pOut, CONST D3DXPLANE *pPlane ) = NULL;

			// Compute a quaternin's axis and angle of rotation. Expects unit quaternions.
			void (WINAPI *D3DXQuaternionToAxisAngle)
				( CONST D3DXQUATERNION *pQ, D3DXVECTOR3 *pAxis, FLOAT *pAngle ) = NULL;

			// Build a quaternion from a rotation matrix.
			D3DXQUATERNION* (WINAPI *D3DXQuaternionRotationMatrix)
				( D3DXQUATERNION *pOut, CONST D3DXMATRIX *pM) = NULL;

			// Rotation about arbitrary axis.
			D3DXQUATERNION* (WINAPI *D3DXQuaternionRotationAxis)
				( D3DXQUATERNION *pOut, CONST D3DXVECTOR3 *pV, FLOAT Angle ) = NULL;

			// Yaw around the Y axis, a pitch around the X axis,
			// and a roll around the Z axis.
			D3DXQUATERNION* (WINAPI *D3DXQuaternionRotationYawPitchRoll)
				( D3DXQUATERNION *pOut, FLOAT Yaw, FLOAT Pitch, FLOAT Roll ) = NULL;

			// Quaternion multiplication.  The result represents the rotation Q2
			// followed by the rotation Q1.  (Out = Q2 * Q1)
			D3DXQUATERNION* (WINAPI *D3DXQuaternionMultiply)
				( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1,
				CONST D3DXQUATERNION *pQ2 ) = NULL;

			D3DXQUATERNION* (WINAPI *D3DXQuaternionNormalize)
				( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ) = NULL;

			// Conjugate and re-norm
			D3DXQUATERNION* (WINAPI *D3DXQuaternionInverse)
				( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ) = NULL;

			// Expects unit quaternions.
			// if q = (cos(theta), sin(theta) * v) = NULL; ln(q) = (0, theta * v)
			D3DXQUATERNION* (WINAPI *D3DXQuaternionLn)
				( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ) = NULL;

			// Expects pure quaternions. (w == 0)  w is ignored in calculation.
			// if q = (0, theta * v) = NULL; exp(q) = (cos(theta), sin(theta) * v)
			D3DXQUATERNION* (WINAPI *D3DXQuaternionExp)
				( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ) = NULL;

			// Spherical linear interpolation between Q1 (t == 0) and Q2 (t == 1).
			// Expects unit quaternions.
			D3DXQUATERNION* (WINAPI *D3DXQuaternionSlerp)
				( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1,
				CONST D3DXQUATERNION *pQ2, FLOAT t ) = NULL;

			// Spherical quadrangle interpolation.
			// Slerp(Slerp(Q1, C, t), Slerp(A, B, t), 2t(1-t))
			D3DXQUATERNION* (WINAPI *D3DXQuaternionSquad)
				( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1,
				CONST D3DXQUATERNION *pA, CONST D3DXQUATERNION *pB,
				CONST D3DXQUATERNION *pC, FLOAT t ) = NULL;

			// Setup control points for spherical quadrangle interpolation
			// from Q1 to Q2.  The control points are chosen in such a way 
			// to ensure the continuity of tangents with adjacent segments.
			void (WINAPI *D3DXQuaternionSquadSetup)
				( D3DXQUATERNION *pAOut, D3DXQUATERNION *pBOut, D3DXQUATERNION *pCOut,
				CONST D3DXQUATERNION *pQ0, CONST D3DXQUATERNION *pQ1, 
				CONST D3DXQUATERNION *pQ2, CONST D3DXQUATERNION *pQ3 ) = NULL;

			// Barycentric interpolation.
			// Slerp(Slerp(Q1, Q2, f+g), Slerp(Q1, Q3, f+g), g/(f+g))
			D3DXQUATERNION* (WINAPI *D3DXQuaternionBaryCentric)
				( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1,
				CONST D3DXQUATERNION *pQ2, CONST D3DXQUATERNION *pQ3,
				FLOAT f, FLOAT g ) = NULL;

			// Normalize plane (so that |a,b,c| == 1)
			D3DXPLANE* (WINAPI *D3DXPlaneNormalize)
				( D3DXPLANE *pOut, CONST D3DXPLANE *pP) = NULL;

			// Find the intersection between a plane and a line.  If the line is
			// parallel to the plane, NULL is returned.
			D3DXVECTOR3* (WINAPI *D3DXPlaneIntersectLine)
				( D3DXVECTOR3 *pOut, CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV1,
				CONST D3DXVECTOR3 *pV2) = NULL;

			// Construct a plane from a point and a normal
			D3DXPLANE* (WINAPI *D3DXPlaneFromPointNormal)
				( D3DXPLANE *pOut, CONST D3DXVECTOR3 *pPoint, CONST D3DXVECTOR3 *pNormal) = NULL;

			// Construct a plane from 3 points
			D3DXPLANE* (WINAPI *D3DXPlaneFromPoints)
				( D3DXPLANE *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2,
				CONST D3DXVECTOR3 *pV3) = NULL;

			// Transform a plane by a matrix.  The vector (a,b,c) must be normal.
			// M should be the inverse transpose of the transformation desired.
			D3DXPLANE* (WINAPI *D3DXPlaneTransform)
				( D3DXPLANE *pOut, CONST D3DXPLANE *pP, CONST D3DXMATRIX *pM ) = NULL;

			// Transform an array of planes by a matrix.  The vectors (a,b,c) must be normal.
			// M should be the inverse transpose of the transformation desired.
			D3DXPLANE* (WINAPI *D3DXPlaneTransformArray)
				( D3DXPLANE *pOut, UINT OutStride, CONST D3DXPLANE *pP, UINT PStride, CONST D3DXMATRIX *pM, UINT n ) = NULL;

			// Interpolate r,g,b between desaturated color and color.
			// DesaturatedColor + s(Color - DesaturatedColor)
			D3DXCOLOR* (WINAPI *D3DXColorAdjustSaturation)
				(D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT s) = NULL;

			// Interpolate r,g,b between 50% grey and color.  Grey + s(Color - Grey)
			D3DXCOLOR* (WINAPI *D3DXColorAdjustContrast)
				(D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT c) = NULL;

			// Calculate Fresnel term given the cosine of theta (likely obtained by
			// taking the dot of two normals), and the refraction index of the material.
			FLOAT (WINAPI *D3DXFresnelTerm)
				(FLOAT CosTheta, FLOAT RefractionIndex) = NULL;   

			HRESULT (WINAPI *D3DXCreateMatrixStack)(
				UINT                Flags, 
				LPD3DXMATRIXSTACK*  ppStack) = NULL;

			FLOAT* (WINAPI *D3DXSHEvalDirection)(  FLOAT *pOut, UINT Order, CONST D3DXVECTOR3 *pDir ) = NULL;

			FLOAT* (WINAPI *D3DXSHRotate)( FLOAT *pOut, UINT Order, CONST D3DXMATRIX *pMatrix, CONST FLOAT *pIn ) = NULL;

			FLOAT* (WINAPI *D3DXSHRotateZ)( FLOAT *pOut, UINT Order, FLOAT Angle, CONST FLOAT *pIn ) = NULL;

			FLOAT* (WINAPI *D3DXSHAdd)( FLOAT *pOut, UINT Order, CONST FLOAT *pA, CONST FLOAT *pB ) = NULL;

			FLOAT* (WINAPI *D3DXSHScale)
				( __out_ecount(Order*Order) FLOAT *pOut, UINT Order, CONST FLOAT *pIn, CONST FLOAT Scale ) = NULL;

			FLOAT (WINAPI *D3DXSHDot)( UINT Order, CONST FLOAT *pA, CONST FLOAT *pB ) = NULL;
			FLOAT* (WINAPI *D3DXSHMultiply2)(FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG) = NULL;
			FLOAT* (WINAPI *D3DXSHMultiply3)(FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG) = NULL;
			FLOAT* (WINAPI *D3DXSHMultiply4)(FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG) = NULL;
			FLOAT* (WINAPI *D3DXSHMultiply5)(FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG) = NULL;
			FLOAT* (WINAPI *D3DXSHMultiply6)(FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG) = NULL;

			HRESULT (WINAPI *D3DXSHEvalDirectionalLight)
				( UINT Order, CONST D3DXVECTOR3 *pDir, 
				FLOAT RIntensity, FLOAT GIntensity, FLOAT BIntensity,
				FLOAT *pROut, 
				FLOAT *pGOut, 
				FLOAT *pBOut ) = NULL;

			HRESULT (WINAPI *D3DXSHEvalSphericalLight)
				( UINT Order, CONST D3DXVECTOR3 *pPos, FLOAT Radius,
				FLOAT RIntensity, FLOAT GIntensity, FLOAT BIntensity,
				FLOAT *pROut, 
				FLOAT *pGOut, 
				FLOAT *pBOut ) = NULL;

			HRESULT (WINAPI *D3DXSHEvalConeLight)
				( UINT Order, CONST D3DXVECTOR3 *pDir, FLOAT Radius,
				FLOAT RIntensity, FLOAT GIntensity, FLOAT BIntensity,
				FLOAT *pROut, 
				FLOAT *pGOut, 
				FLOAT *pBOut ) = NULL;

			HRESULT (WINAPI *D3DXSHEvalHemisphereLight)
				( UINT Order, CONST D3DXVECTOR3 *pDir, D3DXCOLOR Top, D3DXCOLOR Bottom,
				FLOAT *pROut, 
				FLOAT *pGOut, 
				FLOAT *pBOut ) = NULL;

			// Math intersection functions

			BOOL (WINAPI *D3DXIntersectTri)(
				CONST D3DXVECTOR3 *p0,           // Triangle vertex 0 position
				CONST D3DXVECTOR3 *p1,           // Triangle vertex 1 position
				CONST D3DXVECTOR3 *p2,           // Triangle vertex 2 position
				CONST D3DXVECTOR3 *pRayPos,      // Ray origin
				CONST D3DXVECTOR3 *pRayDir,      // Ray direction
				FLOAT *pU,                         // Barycentric Hit Coordinates
				FLOAT *pV,                         // Barycentric Hit Coordinates
				FLOAT *pDist) = NULL;                     // Ray-Intersection Parameter Distance

			BOOL (WINAPI *D3DXSphereBoundProbe)(
				CONST D3DXVECTOR3 *pCenter,
				FLOAT Radius,
				CONST D3DXVECTOR3 *pRayPosition,
				CONST D3DXVECTOR3 *pRayDirection) = NULL;

			BOOL (WINAPI *D3DXBoxBoundProbe)(
				CONST D3DXVECTOR3 *pMin, 
				CONST D3DXVECTOR3 *pMax,
				CONST D3DXVECTOR3 *pRayPosition,
				CONST D3DXVECTOR3 *pRayDirection) = NULL;

			HRESULT (WINAPI *D3DXComputeBoundingSphere)(
				CONST D3DXVECTOR3 *pFirstPosition,	// pointer to first position
				DWORD NumVertices, 
				DWORD dwStride,							// count in bytes to subsequent position vectors
				D3DXVECTOR3 *pCenter, 
				FLOAT *pRadius) = NULL;

			HRESULT (WINAPI *D3DXComputeBoundingBox)(
				CONST D3DXVECTOR3 *pFirstPosition,	// pointer to first position
				DWORD NumVertices, 
				DWORD dwStride,							// count in bytes to subsequent position vectors
				D3DXVECTOR3 *pMin, 
				D3DXVECTOR3 *pMax) = NULL;

			D3DX_CPU_OPTIMIZATION (WINAPI *D3DXCpuOptimizations)(BOOL Enable) = NULL;

			HRESULT (WINAPI *D3DX10CreateSprite)( 
				ID3D10Device*         pDevice, 
				UINT                  cDeviceBufferSize,
				LPD3DX10SPRITE*       ppSprite) = NULL;

			HRESULT (WINAPI *D3DX10CreateThreadPump)(UINT cIoThreads, UINT cProcThreads, ID3DX10ThreadPump **ppThreadPump) = NULL;

			HRESULT (WINAPI *D3DX10CreateFont)(
				ID3D10Device*           pDevice,  
				INT                     Height,
				UINT                    Width,
				UINT                    Weight,
				UINT                    MipLevels,
				BOOL                    Italic,
				UINT                    CharSet,
				UINT                    OutputPrecision,
				UINT                    Quality,
				UINT                    PitchAndFamily,
				LPCWSTR                 pFaceName,
				LPD3DX10FONT*           ppFont) = NULL;

			HRESULT (WINAPI *D3DX10CreateFontIndirect)( 
				ID3D10Device*             pDevice,  
				CONST D3DX10_FONT_DESCW*   pDesc, 
				LPD3DX10FONT*             ppFont) = NULL;

			HRESULT (WINAPI *D3DX10UnsetAllDeviceObjects)(ID3D10Device *pDevice) = NULL;

			HRESULT (WINAPI *D3DX10GetImageInfoFromFile)(
				LPCWSTR                   pSrcFile,
				ID3DX10ThreadPump*        pPump,
				D3DX10_IMAGE_INFO*        pSrcInfo,
				HRESULT*                  pHResult) = NULL;

			HRESULT (WINAPI *D3DX10GetImageInfoFromMemory)(
				LPCVOID                   pSrcData,
				SIZE_T                    SrcDataSize,
				ID3DX10ThreadPump*        pPump,
				D3DX10_IMAGE_INFO*        pSrcInfo,
				HRESULT*                  pHResult) = NULL;

			HRESULT (WINAPI *D3DX10CreateShaderResourceViewFromFile)(
				ID3D10Device*               pDevice,
				LPCWSTR                     pSrcFile,
				D3DX10_IMAGE_LOAD_INFO      *pLoadInfo,
				ID3DX10ThreadPump*          pPump,
				ID3D10ShaderResourceView**  ppShaderResourceView,
				HRESULT*                    pHResult) = NULL;

			HRESULT (WINAPI *D3DX10CreateShaderResourceViewFromMemory)(
				ID3D10Device*              pDevice,
				LPCVOID                    pSrcData,
				SIZE_T                     SrcDataSize,
				D3DX10_IMAGE_LOAD_INFO*    pLoadInfo,
				ID3DX10ThreadPump*         pPump,        
				ID3D10ShaderResourceView** ppShaderResourceView,
				HRESULT*                   pHResult) = NULL;

			HRESULT (WINAPI *D3DX10CreateTextureFromFile)(
				ID3D10Device*               pDevice,
				LPCWSTR                     pSrcFile,
				D3DX10_IMAGE_LOAD_INFO      *pLoadInfo,
				ID3DX10ThreadPump*          pPump,
				ID3D10Resource**            ppTexture,
				HRESULT*                    pHResult) = NULL;

			HRESULT (WINAPI *D3DX10CreateTextureFromMemory)(
				ID3D10Device*             pDevice,
				LPCVOID                   pSrcData,
				SIZE_T                    SrcDataSize,
				D3DX10_IMAGE_LOAD_INFO*   pLoadInfo,    
				ID3DX10ThreadPump*        pPump,    
				ID3D10Resource**          ppTexture,
				HRESULT*                  pHResult) = NULL;

			HRESULT (WINAPI *D3DX10LoadTextureFromTexture)(
				ID3D10Resource            *pSrcTexture,
				D3DX10_TEXTURE_LOAD_INFO  *pLoadInfo,
				ID3D10Resource            *pDstTexture) = NULL;

			HRESULT (WINAPI *D3DX10FilterTexture)(
				ID3D10Resource            *pTexture,
				UINT                      SrcLevel,
				UINT                      MipFilter) = NULL;

			HRESULT (WINAPI *D3DX10SaveTextureToFile)(
				ID3D10Resource            *pSrcTexture,
				D3DX10_IMAGE_FILE_FORMAT    DestFormat,
				LPCWSTR                   pDestFile) = NULL;

			HRESULT (WINAPI *D3DX10SaveTextureToMemory)(
				ID3D10Resource*            pSrcTexture,
				D3DX10_IMAGE_FILE_FORMAT   DestFormat,
				LPD3D10BLOB*               ppDestBuf,
				UINT                       Flags) = NULL;

			HRESULT (WINAPI *D3DX10ComputeNormalMap)(
				ID3D10Texture2D		     *pSrcTexture,
				UINT                      Flags,
				UINT                      Channel,
				FLOAT                     Amplitude,
				ID3D10Texture2D		     *pDestTexture) = NULL;

			HRESULT (WINAPI *D3DX10SHProjectCubeMap)(
				UINT                 Order,
				ID3D10Texture2D      *pCubeMap,
				FLOAT                *pROut,
				FLOAT                *pGOut,
				FLOAT                *pBOut) = NULL;

			HRESULT (WINAPI *D3DX10CompileFromFile)(LPCWSTR pSrcFile, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
				LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult) = NULL;

			HRESULT (WINAPI *D3DX10CompileFromMemory)(LPCSTR pSrcData, SIZE_T SrcDataLen, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, 
				LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult) = NULL;

			HRESULT (WINAPI *D3DX10CreateEffectFromFile)(LPCWSTR pFileName, CONST D3D10_SHADER_MACRO *pDefines, 
				ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice, 
				ID3D10EffectPool *pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors, HRESULT* pHResult) = NULL;

			HRESULT (WINAPI *D3DX10CreateEffectFromMemory)(LPCVOID pData, SIZE_T DataLength, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines, 
				ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice, 
				ID3D10EffectPool *pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors, HRESULT* pHResult) = NULL;

			HRESULT (WINAPI *D3DX10CreateEffectPoolFromFile)(LPCWSTR pFileName, CONST D3D10_SHADER_MACRO *pDefines, 
				ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice, ID3DX10ThreadPump* pPump, 
				ID3D10EffectPool **ppEffectPool, ID3D10Blob **ppErrors, HRESULT* pHResult) = NULL;

			HRESULT (WINAPI *D3DX10CreateEffectPoolFromMemory)(LPCVOID pData, SIZE_T DataLength, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines, 
				ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
				ID3DX10ThreadPump* pPump, ID3D10EffectPool **ppEffectPool, ID3D10Blob **ppErrors, HRESULT* pHResult) = NULL;

			HRESULT (WINAPI *D3DX10PreprocessShaderFromFile)(LPCWSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, 
				LPD3D10INCLUDE pInclude, ID3DX10ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult) = NULL;

			HRESULT (WINAPI *D3DX10PreprocessShaderFromMemory)(LPCSTR pSrcData, SIZE_T SrcDataSize, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, 
				LPD3D10INCLUDE pInclude, ID3DX10ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult) = NULL;

			HRESULT (WINAPI *D3DX10CreateAsyncCompilerProcessor)(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, 
				LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2,
				ID3D10Blob **ppCompiledShader, ID3D10Blob **ppErrorBuffer, ID3DX10DataProcessor **ppProcessor) = NULL;

			HRESULT (WINAPI *D3DX10CreateAsyncEffectCreateProcessor)(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, 
				LPCSTR pProfile, UINT Flags, UINT FXFlags, ID3D10Device *pDevice,
				ID3D10EffectPool *pPool, ID3D10Blob **ppErrorBuffer, ID3DX10DataProcessor **ppProcessor) = NULL;

			HRESULT (WINAPI *D3DX10CreateAsyncEffectPoolCreateProcessor)(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, 
				LPCSTR pProfile, UINT Flags, UINT FXFlags, ID3D10Device *pDevice,
				ID3D10Blob **ppErrorBuffer, ID3DX10DataProcessor **ppProcessor) = NULL;

			HRESULT (WINAPI *D3DX10CreateAsyncShaderPreprocessProcessor)(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, 
				ID3D10Blob** ppShaderText, ID3D10Blob **ppErrorBuffer, ID3DX10DataProcessor **ppProcessor) = NULL;

			HRESULT (WINAPI *D3DX10CreateAsyncFileLoader)(LPCWSTR pFileName, ID3DX10DataLoader **ppDataLoader) = NULL;

			HRESULT (WINAPI *D3DX10CreateAsyncMemoryLoader)(LPCVOID pData, SIZE_T cbData, ID3DX10DataLoader **ppDataLoader) = NULL;

			HRESULT (WINAPI *D3DX10CreateAsyncTextureProcessor)(ID3D10Device *pDevice, D3DX10_IMAGE_LOAD_INFO *pLoadInfo, ID3DX10DataProcessor **ppDataProcessor) = NULL;
			HRESULT (WINAPI *D3DX10CreateAsyncTextureInfoProcessor)(D3DX10_IMAGE_INFO *pImageInfo, ID3DX10DataProcessor **ppDataProcessor) = NULL;
			HRESULT (WINAPI *D3DX10CreateAsyncShaderResourceViewProcessor)(ID3D10Device *pDevice, D3DX10_IMAGE_LOAD_INFO *pLoadInfo, ID3DX10DataProcessor **ppDataProcessor) = NULL;

			//@}
		}

		static bool s_dx10EnableDebug = false;

		// InitializeDirect3D10
		void InitializeDirect3D10( bool enableDebug )
		{
#if _DYNAMIC_LOAD_DX10
			if( fn::s_hDirect3D10Module || fn::s_hDXGIModule )
			{
				TRACE_WARNING( _S("Direct3D10 has been initialized.") );
				return;
			}

			// Load module
			s_dx10EnableDebug = enableDebug;

			fn::s_hDirect3D10Module = ::LoadLibrary( _S("d3d10.dll") );
			fn::s_hDXGIModule = ::LoadLibrary( _S("dxgi.dll") );
			if( fn::s_hDirect3D10Module == NULL || fn::s_hDXGIModule == NULL )
			{
				FATAL_ABORT( _S("Cannot load Direct3D10.") );
			}
#endif

#if _DYNAMIC_LOAD_DX10
#define LOAD_FN( NAME )			*(void**)&(fn::NAME) = ::GetProcAddress( fn::s_hDirect3D10Module , #NAME ); XS_ASSERT( fn::NAME )
#else
#define LOAD_FN( NAME )			*(void**)&(fn::NAME) = &::NAME
#endif
			LOAD_FN( D3D10CreateDevice );
			LOAD_FN( D3D10CreateBlob );
			LOAD_FN( D3D10CreateDeviceAndSwapChain );
			LOAD_FN( D3D10ReflectShader );
			LOAD_FN( D3D10CompileShader );
			LOAD_FN( D3D10DisassembleShader );
			LOAD_FN( D3D10GetPixelShaderProfile );
			LOAD_FN( D3D10GetVertexShaderProfile );
			LOAD_FN( D3D10GetGeometryShaderProfile );
			LOAD_FN( D3D10PreprocessShader );
			LOAD_FN( D3D10GetInputSignatureBlob );
			LOAD_FN( D3D10GetOutputSignatureBlob );
			LOAD_FN( D3D10GetInputAndOutputSignatureBlob );
			LOAD_FN( D3D10GetShaderDebugInfo );
			LOAD_FN( D3D10StateBlockMaskUnion );
			LOAD_FN( D3D10StateBlockMaskIntersect );
			LOAD_FN( D3D10StateBlockMaskDifference );
			LOAD_FN( D3D10StateBlockMaskEnableCapture );
			LOAD_FN( D3D10StateBlockMaskDisableCapture );
			LOAD_FN( D3D10StateBlockMaskEnableAll );
			LOAD_FN( D3D10StateBlockMaskDisableAll );
			LOAD_FN( D3D10StateBlockMaskGetSetting );
			LOAD_FN( D3D10CreateStateBlock );
			LOAD_FN( D3D10CompileEffectFromMemory );
			LOAD_FN( D3D10CreateEffectFromMemory );
			LOAD_FN( D3D10CreateEffectPoolFromMemory );
			LOAD_FN( D3D10DisassembleEffect );

#undef LOAD_FN

			*(void**)&(fn::CreateDXGIFactory) = ::GetProcAddress( fn::s_hDXGIModule , "CreateDXGIFactory" );
		}

#define	MINIMUM_SUPPORT			(27)

		// InitializeDirect3DX10
		void InitializeDirect3DX10( bool enableDebug , uint version )
		{
			// DX9 is also needed.
			dx9::InitializeDirect3D9( enableDebug );
			dx9::InitializeDirect3DX9( enableDebug , version );

#if _DYNAMIC_LOAD_DX10
			if( fn::s_hDirect3DX10Module )
			{
				TRACE_WARNING( _S("Direct3DX10 has been initialized.") );
				return;
			}

			for( uint ver = version ; ver >= MINIMUM_SUPPORT ; --ver )
			{
				wchar_t buf[64];
				swprintf( buf , enableDebug ? L"d3dx10d_%u.dll" : L"d3dx10_%u.dll" , ver );

				// Load module
				fn::s_hDirect3DX10Module = ::LoadLibrary( buf );

				if( fn::s_hDirect3DX10Module )
					break;
				TRACE_WARNING( _S("InitializeDirect3DX9: Failed to load library <%s>, try to load older version." ) , buf );
			}
			if( fn::s_hDirect3DX10Module == NULL && enableDebug )
			{
				TRACE_ERROR( _S("No debug version of Direct3DX10 exists, use retail verison.") );
				for( uint ver = version ; ver >= MINIMUM_SUPPORT ; --ver )
				{
					wchar_t buf[64];
					swprintf( buf , L"d3dx10_%u.dll" , ver );

					// Load module
					fn::s_hDirect3DX10Module = ::LoadLibrary( buf );

					if( fn::s_hDirect3DX10Module )
						break;
					TRACE_WARNING( _S("InitializeDirect3DX9: Failed to load library <%s>, try to load older version." ) , buf );
				}
			}
			if( fn::s_hDirect3DX10Module == NULL )
			{
				if( enableDebug )
				{
					TRACE_WARNING( _S("InitializeDirect3DX10: Cannot load d3dx9 debug version, try non-debug version." ) );

					// Try to load again.
					InitializeDirect3DX10( false , version );
				}
				if( fn::s_hDirect3DX10Module == NULL )
				{
					FATAL_ABORT( _S("Cannot load Direct3DX10.") );
				}
			}
#endif

#if _DYNAMIC_LOAD_DX10
#define LOAD_FN( NAME )			*(void**)&(fn::NAME) = ::GetProcAddress( fn::s_hDirect3DX10Module , #NAME ); XS_ASSERT( fn::NAME )
#define LOAD_FNW( NAME )		*(void**)&(fn::NAME) = ::GetProcAddress( fn::s_hDirect3DX10Module , #NAME "W" ); XS_ASSERT(fn::NAME)
#else
#define LOAD_FN( NAME )			*(void**)&(fn::NAME) = &::NAME
#endif

			LOAD_FN( D3DX10CreateDevice );
			LOAD_FN( D3DX10CreateDeviceAndSwapChain );
			LOAD_FN( D3DX10CheckVersion );
			LOAD_FN( D3DXFloat32To16Array );
			LOAD_FN( D3DXFloat16To32Array );
			LOAD_FN( D3DXVec2Normalize );
			LOAD_FN( D3DXVec2Hermite );
			LOAD_FN( D3DXVec2CatmullRom );
			LOAD_FN( D3DXVec2BaryCentric );
			LOAD_FN( D3DXVec2Transform );
			LOAD_FN( D3DXVec2TransformCoord );
			LOAD_FN( D3DXVec2TransformNormal );
			LOAD_FN( D3DXVec2TransformArray );
			LOAD_FN( D3DXVec2TransformCoordArray );
			LOAD_FN( D3DXVec2TransformNormalArray );
			LOAD_FN( D3DXVec3Normalize );
			LOAD_FN( D3DXVec3Hermite );
			LOAD_FN( D3DXVec3CatmullRom );
			LOAD_FN( D3DXVec3BaryCentric );
			LOAD_FN( D3DXVec3Transform );
			LOAD_FN( D3DXVec3TransformCoord );
			LOAD_FN( D3DXVec3TransformNormal );
			LOAD_FN( D3DXVec3TransformArray );
			LOAD_FN( D3DXVec3TransformCoordArray );
			LOAD_FN( D3DXVec3TransformNormalArray );
			LOAD_FN( D3DXVec3Project );
			LOAD_FN( D3DXVec3Unproject );
			LOAD_FN( D3DXVec3ProjectArray );
			LOAD_FN( D3DXVec3UnprojectArray );
			LOAD_FN( D3DXVec4Cross );
			LOAD_FN( D3DXVec4Normalize );
			LOAD_FN( D3DXVec4Hermite );
			LOAD_FN( D3DXVec4CatmullRom );
			LOAD_FN( D3DXVec4BaryCentric );
			LOAD_FN( D3DXVec4Transform );
			LOAD_FN( D3DXVec4TransformArray );
			LOAD_FN( D3DXMatrixDeterminant );
			LOAD_FN( D3DXMatrixDecompose );
			LOAD_FN( D3DXMatrixTranspose );
			LOAD_FN( D3DXMatrixMultiply );
			LOAD_FN( D3DXMatrixMultiplyTranspose );
			LOAD_FN( D3DXMatrixInverse );
			LOAD_FN( D3DXMatrixScaling );
			LOAD_FN( D3DXMatrixTranslation );
			LOAD_FN( D3DXMatrixRotationX );
			LOAD_FN( D3DXMatrixRotationY );
			LOAD_FN( D3DXMatrixRotationZ );
			LOAD_FN( D3DXMatrixRotationAxis );
			LOAD_FN( D3DXMatrixRotationQuaternion );
			LOAD_FN( D3DXMatrixRotationYawPitchRoll );
			LOAD_FN( D3DXMatrixTransformation );
			LOAD_FN( D3DXMatrixTransformation2D );
			LOAD_FN( D3DXMatrixAffineTransformation );
			LOAD_FN( D3DXMatrixAffineTransformation2D );
			LOAD_FN( D3DXMatrixLookAtRH );
			LOAD_FN( D3DXMatrixLookAtLH );
			LOAD_FN( D3DXMatrixPerspectiveRH );
			LOAD_FN( D3DXMatrixPerspectiveLH );
			LOAD_FN( D3DXMatrixPerspectiveFovRH );
			LOAD_FN( D3DXMatrixPerspectiveFovLH );
			LOAD_FN( D3DXMatrixPerspectiveOffCenterRH );
			LOAD_FN( D3DXMatrixPerspectiveOffCenterLH );
			LOAD_FN( D3DXMatrixOrthoRH );
			LOAD_FN( D3DXMatrixOrthoLH );
			LOAD_FN( D3DXMatrixOrthoOffCenterRH );
			LOAD_FN( D3DXMatrixOrthoOffCenterLH );
			LOAD_FN( D3DXMatrixShadow );
			LOAD_FN( D3DXMatrixReflect );
			LOAD_FN( D3DXQuaternionToAxisAngle );
			LOAD_FN( D3DXQuaternionRotationMatrix );
			LOAD_FN( D3DXQuaternionRotationAxis );
			LOAD_FN( D3DXQuaternionRotationYawPitchRoll );
			LOAD_FN( D3DXQuaternionMultiply );
			LOAD_FN( D3DXQuaternionNormalize );
			LOAD_FN( D3DXQuaternionInverse );
			LOAD_FN( D3DXQuaternionLn );
			LOAD_FN( D3DXQuaternionExp );
			LOAD_FN( D3DXQuaternionSlerp );
			LOAD_FN( D3DXQuaternionSquad );
			LOAD_FN( D3DXQuaternionSquadSetup );
			LOAD_FN( D3DXQuaternionBaryCentric );
			LOAD_FN( D3DXPlaneNormalize );
			LOAD_FN( D3DXPlaneIntersectLine );
			LOAD_FN( D3DXPlaneFromPointNormal );
			LOAD_FN( D3DXPlaneFromPoints );
			LOAD_FN( D3DXPlaneTransform );
			LOAD_FN( D3DXPlaneTransformArray );
			LOAD_FN( D3DXColorAdjustSaturation );
			LOAD_FN( D3DXColorAdjustContrast );
			LOAD_FN( D3DXFresnelTerm );
			LOAD_FN( D3DXCreateMatrixStack );
			LOAD_FN( D3DXSHEvalDirection );
			LOAD_FN( D3DXSHRotate );
			LOAD_FN( D3DXSHRotateZ );
			LOAD_FN( D3DXSHAdd );
			LOAD_FN( D3DXSHScale );
			LOAD_FN( D3DXSHDot );
			LOAD_FN( D3DXSHMultiply2 );
			LOAD_FN( D3DXSHMultiply3 );
			LOAD_FN( D3DXSHMultiply4 );
			LOAD_FN( D3DXSHMultiply5 );
			LOAD_FN( D3DXSHMultiply6 );
			LOAD_FN( D3DXSHEvalDirectionalLight );
			LOAD_FN( D3DXSHEvalSphericalLight );
			LOAD_FN( D3DXSHEvalConeLight );
			LOAD_FN( D3DXSHEvalHemisphereLight );
			LOAD_FN( D3DXIntersectTri );
			LOAD_FN( D3DXSphereBoundProbe );
			LOAD_FN( D3DXBoxBoundProbe );
			LOAD_FN( D3DXComputeBoundingSphere );
			LOAD_FN( D3DXComputeBoundingBox );
			LOAD_FN( D3DXCpuOptimizations );
			LOAD_FN( D3DX10CreateSprite );
			LOAD_FN( D3DX10CreateThreadPump );
			LOAD_FNW( D3DX10CreateFont );
			LOAD_FNW( D3DX10CreateFontIndirect );
			LOAD_FN( D3DX10UnsetAllDeviceObjects );
			LOAD_FNW( D3DX10GetImageInfoFromFile );
			LOAD_FN( D3DX10GetImageInfoFromMemory );
			LOAD_FNW( D3DX10CreateShaderResourceViewFromFile );
			LOAD_FN( D3DX10CreateShaderResourceViewFromMemory );
			LOAD_FNW( D3DX10CreateTextureFromFile );
			LOAD_FN( D3DX10CreateTextureFromMemory );
			LOAD_FN( D3DX10LoadTextureFromTexture );
			LOAD_FN( D3DX10FilterTexture );
			LOAD_FNW( D3DX10SaveTextureToFile );
			LOAD_FN( D3DX10SaveTextureToMemory );
			LOAD_FN( D3DX10ComputeNormalMap );
			LOAD_FN( D3DX10SHProjectCubeMap );
			LOAD_FNW( D3DX10CompileFromFile );
			LOAD_FN( D3DX10CompileFromMemory );
			LOAD_FNW( D3DX10CreateEffectFromFile );
			LOAD_FN( D3DX10CreateEffectFromMemory );
			LOAD_FNW( D3DX10CreateEffectPoolFromFile );
			LOAD_FN( D3DX10CreateEffectPoolFromMemory );
			LOAD_FNW( D3DX10PreprocessShaderFromFile );
			LOAD_FN( D3DX10PreprocessShaderFromMemory );
			LOAD_FN( D3DX10CreateAsyncCompilerProcessor );
			LOAD_FN( D3DX10CreateAsyncEffectCreateProcessor );
			LOAD_FN( D3DX10CreateAsyncEffectPoolCreateProcessor );
			LOAD_FN( D3DX10CreateAsyncShaderPreprocessProcessor );
			LOAD_FNW( D3DX10CreateAsyncFileLoader );
			LOAD_FN( D3DX10CreateAsyncMemoryLoader );
			LOAD_FN( D3DX10CreateAsyncTextureProcessor );
			LOAD_FN( D3DX10CreateAsyncTextureInfoProcessor );
			LOAD_FN( D3DX10CreateAsyncShaderResourceViewProcessor );

#undef LOAD_FN
#undef LOAD_FNW

		}

		// Create a Direct3D 10.0 device that represents the display adapter.
		HRESULT WINAPI D3D10CreateDevice(IDXGIAdapter *pAdapter, D3D10_DRIVER_TYPE DriverType, HMODULE Software, UINT Flags, UINT SDKVersion, ID3D10Device **ppDevice )
		{
			if( s_dx10EnableDebug )
				Flags |= D3D10_CREATE_DEVICE_DEBUG;
			else
				Flags &= ~D3D10_CREATE_DEVICE_DEBUG;
			return fn::D3D10CreateDevice(pAdapter, DriverType, Software, 0, SDKVersion, ppDevice );
		}

		// Create a buffer.
		HRESULT WINAPI D3D10CreateBlob(SIZE_T NumBytes, LPD3D10BLOB *ppBuffer )
		{
			return fn::D3D10CreateBlob(NumBytes, ppBuffer );
		}

		// Create a Direct3D 10.0 device and a swap chain.
		HRESULT WINAPI D3D10CreateDeviceAndSwapChain(IDXGIAdapter *pAdapter, D3D10_DRIVER_TYPE DriverType, HMODULE Software, UINT Flags, UINT SDKVersion, DXGI_SWAP_CHAIN_DESC *pSwapChainDesc, IDXGISwapChain **ppSwapChain, ID3D10Device **ppDevice )
		{
			if( s_dx10EnableDebug )
				Flags |= D3D10_CREATE_DEVICE_DEBUG;
			else
				Flags &= ~D3D10_CREATE_DEVICE_DEBUG;
			return fn::D3D10CreateDeviceAndSwapChain(pAdapter, DriverType, Software, 0, SDKVersion, pSwapChainDesc, ppSwapChain, ppDevice );
		}

		HRESULT WINAPI CreateDXGIFactory( REFIID riid, void **ppFactory )
		{
			return fn::CreateDXGIFactory( riid , ppFactory );
		}

		HRESULT WINAPI D3D10ReflectShader(CONST void* pShaderBytecode, SIZE_T BytecodeLength, ID3D10ShaderReflection **ppReflector)
		{
			return fn::D3D10ReflectShader(pShaderBytecode, BytecodeLength, ppReflector);
		}

		HRESULT WINAPI D3D10CompileShader(LPCSTR pSrcData, SIZE_T SrcDataLen, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs)
		{
			return fn::D3D10CompileShader(pSrcData, SrcDataLen, pFileName, pDefines, pInclude, pFunctionName, pProfile, Flags, ppShader, ppErrorMsgs);
		}

		HRESULT WINAPI D3D10DisassembleShader(CONST void *pShader, SIZE_T BytecodeLength, BOOL EnableColorCode, LPCSTR pComments, ID3D10Blob** ppDisassembly)
		{
			return fn::D3D10DisassembleShader(pShader, BytecodeLength, EnableColorCode, pComments,  ppDisassembly);
		}

		LPCSTR WINAPI D3D10GetPixelShaderProfile(ID3D10Device *pDevice)
		{
			return fn::D3D10GetPixelShaderProfile(pDevice);
		}

		LPCSTR WINAPI D3D10GetVertexShaderProfile(ID3D10Device *pDevice)
		{
			return fn::D3D10GetVertexShaderProfile(pDevice);
		}

		LPCSTR WINAPI D3D10GetGeometryShaderProfile(ID3D10Device *pDevice)
		{
			return fn::D3D10GetGeometryShaderProfile(pDevice);
		}


		HRESULT WINAPI D3D10PreprocessShader(LPCSTR pSrcData, SIZE_T SrcDataSize, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs)
		{
			return fn::D3D10PreprocessShader(pSrcData, SrcDataSize, pFileName, pDefines, pInclude,  ppShaderText,  ppErrorMsgs);
		}


		HRESULT WINAPI D3D10GetInputSignatureBlob(CONST void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10Blob **ppSignatureBlob)
		{
			return fn::D3D10GetInputSignatureBlob(pShaderBytecode, BytecodeLength, ppSignatureBlob);
		}

		HRESULT WINAPI D3D10GetOutputSignatureBlob(CONST void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10Blob **ppSignatureBlob)
		{
			return fn::D3D10GetOutputSignatureBlob(pShaderBytecode, BytecodeLength, ppSignatureBlob);
		}

		HRESULT WINAPI D3D10GetInputAndOutputSignatureBlob(CONST void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10Blob **ppSignatureBlob)
		{
			return fn::D3D10GetInputAndOutputSignatureBlob(pShaderBytecode, BytecodeLength, ppSignatureBlob);
		}


		HRESULT WINAPI D3D10GetShaderDebugInfo(CONST void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10Blob** ppDebugInfo)
		{
			return fn::D3D10GetShaderDebugInfo(pShaderBytecode, BytecodeLength,  ppDebugInfo);
		}


		HRESULT WINAPI D3D10StateBlockMaskUnion(D3D10_STATE_BLOCK_MASK *pA, D3D10_STATE_BLOCK_MASK *pB, D3D10_STATE_BLOCK_MASK *pResult)
		{
			return fn::D3D10StateBlockMaskUnion(pA, pB, pResult);
		}

		HRESULT WINAPI D3D10StateBlockMaskIntersect(D3D10_STATE_BLOCK_MASK *pA, D3D10_STATE_BLOCK_MASK *pB, D3D10_STATE_BLOCK_MASK *pResult)
		{
			return fn::D3D10StateBlockMaskIntersect(pA, pB, pResult);
		}

		HRESULT WINAPI D3D10StateBlockMaskDifference(D3D10_STATE_BLOCK_MASK *pA, D3D10_STATE_BLOCK_MASK *pB, D3D10_STATE_BLOCK_MASK *pResult)
		{
			return fn::D3D10StateBlockMaskDifference(pA, pB, pResult);
		}

		HRESULT WINAPI D3D10StateBlockMaskEnableCapture(D3D10_STATE_BLOCK_MASK *pMask, D3D10_DEVICE_STATE_TYPES StateType, UINT RangeStart, UINT RangeLength)
		{
			return fn::D3D10StateBlockMaskEnableCapture(pMask, StateType, RangeStart, RangeLength);
		}

		HRESULT WINAPI D3D10StateBlockMaskDisableCapture(D3D10_STATE_BLOCK_MASK *pMask, D3D10_DEVICE_STATE_TYPES StateType, UINT RangeStart, UINT RangeLength)
		{
			return fn::D3D10StateBlockMaskDisableCapture(pMask, StateType, RangeStart, RangeLength);
		}

		HRESULT WINAPI D3D10StateBlockMaskEnableAll(D3D10_STATE_BLOCK_MASK *pMask)
		{
			return fn::D3D10StateBlockMaskEnableAll(pMask);
		}

		HRESULT WINAPI D3D10StateBlockMaskDisableAll(D3D10_STATE_BLOCK_MASK *pMask)
		{
			return fn::D3D10StateBlockMaskDisableAll(pMask);
		}

		BOOL WINAPI D3D10StateBlockMaskGetSetting(D3D10_STATE_BLOCK_MASK *pMask, D3D10_DEVICE_STATE_TYPES StateType, UINT Entry)
		{
			return fn::D3D10StateBlockMaskGetSetting(pMask, StateType, Entry);
		}


		HRESULT WINAPI D3D10CreateStateBlock(ID3D10Device *pDevice, D3D10_STATE_BLOCK_MASK *pStateBlockMask, ID3D10StateBlock **ppStateBlock)
		{
			return fn::D3D10CreateStateBlock(pDevice, pStateBlockMask, ppStateBlock);
		}


		HRESULT WINAPI D3D10CompileEffectFromMemory(void *pData, SIZE_T DataLength, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines, ID3D10Include *pInclude, UINT HLSLFlags, UINT FXFlags, ID3D10Blob **ppCompiledEffect, ID3D10Blob **ppErrors)
		{
			return fn::D3D10CompileEffectFromMemory(pData, DataLength, pSrcFileName, pDefines, pInclude, HLSLFlags, FXFlags, ppCompiledEffect, ppErrors);
		}


		HRESULT WINAPI D3D10CreateEffectFromMemory(void *pData, SIZE_T DataLength, UINT FXFlags, ID3D10Device *pDevice, ID3D10EffectPool *pEffectPool, ID3D10Effect **ppEffect)
		{
			return fn::D3D10CreateEffectFromMemory(pData, DataLength, FXFlags, pDevice, pEffectPool, ppEffect);
		}


		HRESULT WINAPI D3D10CreateEffectPoolFromMemory(void *pData, SIZE_T DataLength, UINT FXFlags, ID3D10Device *pDevice, ID3D10EffectPool **ppEffectPool)
		{
			return fn::D3D10CreateEffectPoolFromMemory(pData, DataLength, FXFlags, pDevice, ppEffectPool);
		}


		HRESULT WINAPI D3D10DisassembleEffect(ID3D10Effect *pEffect, BOOL EnableColorCode, ID3D10Blob **ppDisassembly)
		{
			return fn::D3D10DisassembleEffect(pEffect, EnableColorCode, ppDisassembly);
		}


		HRESULT WINAPI D3DX10CreateDevice(IDXGIAdapter *pAdapter, D3D10_DRIVER_TYPE DriverType, HMODULE Software, UINT Flags, ID3D10Device **ppDevice)
		{
			return fn::D3DX10CreateDevice(pAdapter, DriverType, Software, Flags, ppDevice);
		}


		HRESULT WINAPI D3DX10CreateDeviceAndSwapChain(IDXGIAdapter *pAdapter, D3D10_DRIVER_TYPE DriverType, HMODULE Software, UINT Flags, DXGI_SWAP_CHAIN_DESC *pSwapChainDesc, IDXGISwapChain **ppSwapChain, ID3D10Device **ppDevice)
		{
			return fn::D3DX10CreateDeviceAndSwapChain(pAdapter, DriverType, Software, Flags, pSwapChainDesc, ppSwapChain, ppDevice);
		}


		HRESULT WINAPI D3DX10CheckVersion(UINT D3DSdkVersion, UINT D3DX10SdkVersion)
		{
			return fn::D3DX10CheckVersion(D3DSdkVersion, D3DX10SdkVersion);
		}


		// Converts an array 32-bit floats to 16-bit floats
		D3DXFLOAT16* WINAPI D3DXFloat32To16Array(D3DXFLOAT16* pOut, CONST FLOAT* pIn, UINT n )
		{
			return fn::D3DXFloat32To16Array(pOut, pIn, n );
		}


		// Converts an array 16-bit floats to 32-bit floats
		FLOAT* WINAPI D3DXFloat16To32Array(FLOAT* pOut, CONST D3DXFLOAT16* pIn, UINT n )
		{
			return fn::D3DXFloat16To32Array(pOut, pIn, n );
		}


		// Returns the normalized version of a 2D vector.
		D3DXVECTOR2* WINAPI D3DXVec2Normalize(D3DXVECTOR2* pOut, CONST D3DXVECTOR2* pV )
		{
			return fn::D3DXVec2Normalize(pOut, pV );
		}


		// Hermite interpolation between position V1, tangent T1 (when s == 0)
		// and position V2, tangent T2 (when s == 1).
		D3DXVECTOR2* WINAPI D3DXVec2Hermite(D3DXVECTOR2* pOut, CONST D3DXVECTOR2* pV1, CONST D3DXVECTOR2* pT1, CONST D3DXVECTOR2* pV2, CONST D3DXVECTOR2* pT2, FLOAT s )
		{
			return fn::D3DXVec2Hermite(pOut, pV1, pT1, pV2, pT2, s );
		}


		// CatmullRom interpolation between V1 (when s == 0) and V2 (when s == 1)
		D3DXVECTOR2* WINAPI D3DXVec2CatmullRom(D3DXVECTOR2* pOut, CONST D3DXVECTOR2* pV0, CONST D3DXVECTOR2* pV1, CONST D3DXVECTOR2* pV2, CONST D3DXVECTOR2* pV3, FLOAT s )
		{
			return fn::D3DXVec2CatmullRom(pOut, pV0, pV1, pV2, pV3, s );
		}


		// Barycentric coordinates.  V1 + f(V2-V1) + g(V3-V1)
		D3DXVECTOR2* WINAPI D3DXVec2BaryCentric(D3DXVECTOR2* pOut, CONST D3DXVECTOR2* pV1, CONST D3DXVECTOR2* pV2, CONST D3DXVECTOR2* pV3, FLOAT f, FLOAT g)
		{
			return fn::D3DXVec2BaryCentric(pOut, pV1, pV2, pV3, f, g);
		}


		// Transform (x, y, 0, 1) by matrix.
		D3DXVECTOR4* WINAPI D3DXVec2Transform(D3DXVECTOR4* pOut, CONST D3DXVECTOR2* pV, CONST D3DXMATRIX* pM )
		{
			return fn::D3DXVec2Transform(pOut, pV, pM );
		}


		// Transform (x, y, 0, 1) by matrix, project result back into w=1.
		D3DXVECTOR2* WINAPI D3DXVec2TransformCoord(D3DXVECTOR2* pOut, CONST D3DXVECTOR2* pV, CONST D3DXMATRIX* pM )
		{
			return fn::D3DXVec2TransformCoord(pOut, pV, pM );
		}


		// Transform (x, y, 0, 0) by matrix.
		D3DXVECTOR2* WINAPI D3DXVec2TransformNormal(D3DXVECTOR2* pOut, CONST D3DXVECTOR2* pV, CONST D3DXMATRIX* pM )
		{
			return fn::D3DXVec2TransformNormal(pOut, pV, pM );
		}

		     
		// Transform Array (x, y, 0, 1) by matrix.
		D3DXVECTOR4* WINAPI D3DXVec2TransformArray(D3DXVECTOR4* pOut, UINT OutStride, CONST D3DXVECTOR2* pV, UINT VStride, CONST D3DXMATRIX* pM, UINT n)
		{
			return fn::D3DXVec2TransformArray(pOut, OutStride, pV, VStride, pM, n);
		}


		// Transform Array (x, y, 0, 1) by matrix, project result back into w=1.
		D3DXVECTOR2* WINAPI D3DXVec2TransformCoordArray(D3DXVECTOR2* pOut, UINT OutStride, CONST D3DXVECTOR2* pV, UINT VStride, CONST D3DXMATRIX* pM, UINT n )
		{
			return fn::D3DXVec2TransformCoordArray(pOut, OutStride, pV, VStride, pM, n );
		}


		// Transform Array (x, y, 0, 0) by matrix.
		D3DXVECTOR2* WINAPI D3DXVec2TransformNormalArray(D3DXVECTOR2* pOut, UINT OutStride, CONST D3DXVECTOR2* pV, UINT VStride, CONST D3DXMATRIX* pM, UINT n )
		{
			return fn::D3DXVec2TransformNormalArray(pOut, OutStride, pV, VStride, pM, n );
		}


		// Returns the normalized version of a 3D vector.
		D3DXVECTOR3* WINAPI D3DXVec3Normalize(D3DXVECTOR3* pOut, CONST D3DXVECTOR3* pV )
		{
			return fn::D3DXVec3Normalize(pOut, pV );
		}


		// Hermite interpolation between position V1, tangent T1 (when s == 0)
		// and position V2, tangent T2 (when s == 1).
		D3DXVECTOR3* WINAPI D3DXVec3Hermite(D3DXVECTOR3* pOut, CONST D3DXVECTOR3* pV1, CONST D3DXVECTOR3* pT1, CONST D3DXVECTOR3* pV2, CONST D3DXVECTOR3* pT2, FLOAT s )
		{
			return fn::D3DXVec3Hermite(pOut, pV1, pT1, pV2, pT2, s );
		}


		// CatmullRom interpolation between V1 (when s == 0) and V2 (when s == 1)
		D3DXVECTOR3* WINAPI D3DXVec3CatmullRom(D3DXVECTOR3* pOut, CONST D3DXVECTOR3* pV0, CONST D3DXVECTOR3* pV1, CONST D3DXVECTOR3* pV2, CONST D3DXVECTOR3* pV3, FLOAT s )
		{
			return fn::D3DXVec3CatmullRom(pOut, pV0, pV1, pV2, pV3, s );
		}


		// Barycentric coordinates.  V1 + f(V2-V1) + g(V3-V1)
		D3DXVECTOR3* WINAPI D3DXVec3BaryCentric(D3DXVECTOR3* pOut, CONST D3DXVECTOR3* pV1, CONST D3DXVECTOR3* pV2, CONST D3DXVECTOR3* pV3, FLOAT f, FLOAT g)
		{
			return fn::D3DXVec3BaryCentric(pOut, pV1, pV2, pV3, f, g);
		}


		// Transform (x, y, z, 1) by matrix.
		D3DXVECTOR4* WINAPI D3DXVec3Transform(D3DXVECTOR4* pOut, CONST D3DXVECTOR3* pV, CONST D3DXMATRIX* pM )
		{
			return fn::D3DXVec3Transform(pOut, pV, pM );
		}


		// Transform (x, y, z, 1) by matrix, project result back into w=1.
		D3DXVECTOR3* WINAPI D3DXVec3TransformCoord(D3DXVECTOR3* pOut, CONST D3DXVECTOR3* pV, CONST D3DXMATRIX* pM )
		{
			return fn::D3DXVec3TransformCoord(pOut, pV, pM );
		}


		// Transform (x, y, z, 0) by matrix.  If you transforming a normal by a 
		// non-affine matrix, the matrix you pass to this function should be the 
		// transpose of the inverse of the matrix you would use to transform a coord.
		D3DXVECTOR3* WINAPI D3DXVec3TransformNormal(D3DXVECTOR3* pOut, CONST D3DXVECTOR3* pV, CONST D3DXMATRIX* pM )
		{
			return fn::D3DXVec3TransformNormal(pOut, pV, pM );
		}



		// Transform Array (x, y, z, 1) by matrix. 
		D3DXVECTOR4* WINAPI D3DXVec3TransformArray(D3DXVECTOR4* pOut, UINT OutStride, CONST D3DXVECTOR3* pV, UINT VStride, CONST D3DXMATRIX* pM, UINT n )
		{
			return fn::D3DXVec3TransformArray(pOut, OutStride, pV, VStride, pM, n );
		}


		// Transform Array (x, y, z, 1) by matrix, project result back into w=1.
		D3DXVECTOR3* WINAPI D3DXVec3TransformCoordArray(D3DXVECTOR3* pOut, UINT OutStride, CONST D3DXVECTOR3* pV, UINT VStride, CONST D3DXMATRIX* pM, UINT n )
		{
			return fn::D3DXVec3TransformCoordArray(pOut, OutStride, pV, VStride, pM, n );
		}


		// Transform (x, y, z, 0) by matrix.  If you transforming a normal by a 
		// non-affine matrix, the matrix you pass to this function should be the 
		// transpose of the inverse of the matrix you would use to transform a coord.
		D3DXVECTOR3* WINAPI D3DXVec3TransformNormalArray(D3DXVECTOR3* pOut, UINT OutStride, CONST D3DXVECTOR3* pV, UINT VStride, CONST D3DXMATRIX* pM, UINT n )
		{
			return fn::D3DXVec3TransformNormalArray(pOut, OutStride, pV, VStride, pM, n );
		}


		// Project vector from object space into screen space
		D3DXVECTOR3* WINAPI D3DXVec3Project(D3DXVECTOR3* pOut, CONST D3DXVECTOR3* pV, CONST D3D10_VIEWPORT* pViewport, CONST D3DXMATRIX* pProjection, CONST D3DXMATRIX* pView, CONST D3DXMATRIX* pWorld)
		{
			return fn::D3DXVec3Project(pOut, pV, pViewport, pProjection, pView, pWorld);
		}


		// Project vector from screen space into object space
		D3DXVECTOR3* WINAPI D3DXVec3Unproject(D3DXVECTOR3* pOut, CONST D3DXVECTOR3* pV, CONST D3D10_VIEWPORT* pViewport, CONST D3DXMATRIX* pProjection, CONST D3DXMATRIX* pView, CONST D3DXMATRIX* pWorld)
		{
			return fn::D3DXVec3Unproject(pOut, pV, pViewport, pProjection, pView, pWorld);
		}


		// Project vector Array from object space into screen space
		D3DXVECTOR3* WINAPI D3DXVec3ProjectArray(D3DXVECTOR3* pOut, UINT OutStride, CONST D3DXVECTOR3* pV, UINT VStride, CONST D3D10_VIEWPORT* pViewport, CONST D3DXMATRIX* pProjection, CONST D3DXMATRIX* pView, CONST D3DXMATRIX* pWorld, UINT n)
		{
			return fn::D3DXVec3ProjectArray(pOut, OutStride, pV, VStride, pViewport, pProjection, pView, pWorld, n);
		}


		// Project vector Array from screen space into object space
		D3DXVECTOR3* WINAPI D3DXVec3UnprojectArray(D3DXVECTOR3* pOut, UINT OutStride, CONST D3DXVECTOR3* pV, UINT VStride, CONST D3D10_VIEWPORT* pViewport, CONST D3DXMATRIX* pProjection, CONST D3DXMATRIX* pView, CONST D3DXMATRIX* pWorld, UINT n)
		{
			return fn::D3DXVec3UnprojectArray(pOut, OutStride, pV, VStride, pViewport, pProjection, pView, pWorld, n);
		}


		// Cross-product in 4 dimensions.
		D3DXVECTOR4* WINAPI D3DXVec4Cross(D3DXVECTOR4* pOut, CONST D3DXVECTOR4* pV1, CONST D3DXVECTOR4* pV2, CONST D3DXVECTOR4* pV3)
		{
			return fn::D3DXVec4Cross(pOut, pV1, pV2, pV3);
		}


		D3DXVECTOR4* WINAPI D3DXVec4Normalize(D3DXVECTOR4* pOut, CONST D3DXVECTOR4* pV )
		{
			return fn::D3DXVec4Normalize(pOut, pV );
		}


		// Hermite interpolation between position V1, tangent T1 (when s == 0)
		// and position V2, tangent T2 (when s == 1).
		D3DXVECTOR4* WINAPI D3DXVec4Hermite(D3DXVECTOR4* pOut, CONST D3DXVECTOR4* pV1, CONST D3DXVECTOR4* pT1, CONST D3DXVECTOR4* pV2, CONST D3DXVECTOR4* pT2, FLOAT s )
		{
			return fn::D3DXVec4Hermite(pOut, pV1, pT1, pV2, pT2, s );
		}


		// CatmullRom interpolation between V1 (when s == 0) and V2 (when s == 1)
		D3DXVECTOR4* WINAPI D3DXVec4CatmullRom(D3DXVECTOR4* pOut, CONST D3DXVECTOR4* pV0, CONST D3DXVECTOR4* pV1, CONST D3DXVECTOR4* pV2, CONST D3DXVECTOR4* pV3, FLOAT s )
		{
			return fn::D3DXVec4CatmullRom(pOut, pV0, pV1, pV2, pV3, s );
		}


		// Barycentric coordinates.  V1 + f(V2-V1) + g(V3-V1)
		D3DXVECTOR4* WINAPI D3DXVec4BaryCentric(D3DXVECTOR4* pOut, CONST D3DXVECTOR4* pV1, CONST D3DXVECTOR4* pV2, CONST D3DXVECTOR4* pV3, FLOAT f, FLOAT g)
		{
			return fn::D3DXVec4BaryCentric(pOut, pV1, pV2, pV3, f, g);
		}


		// Transform vector by matrix.
		D3DXVECTOR4* WINAPI D3DXVec4Transform(D3DXVECTOR4* pOut, CONST D3DXVECTOR4* pV, CONST D3DXMATRIX* pM )
		{
			return fn::D3DXVec4Transform(pOut, pV, pM );
		}

		    
		// Transform vector array by matrix.
		D3DXVECTOR4* WINAPI D3DXVec4TransformArray(D3DXVECTOR4* pOut, UINT OutStride, CONST D3DXVECTOR4* pV, UINT VStride, CONST D3DXMATRIX* pM, UINT n )
		{
			return fn::D3DXVec4TransformArray(pOut, OutStride, pV, VStride, pM, n );
		}


		FLOAT WINAPI D3DXMatrixDeterminant(CONST D3DXMATRIX* pM )
		{
			return fn::D3DXMatrixDeterminant(pM );
		}


		HRESULT WINAPI D3DXMatrixDecompose(D3DXVECTOR3* pOutScale, D3DXQUATERNION* pOutRotation, D3DXVECTOR3* pOutTranslation, CONST D3DXMATRIX* pM )
		{
			return fn::D3DXMatrixDecompose(pOutScale, pOutRotation, pOutTranslation, pM );
		}


		D3DXMATRIX* WINAPI D3DXMatrixTranspose(D3DXMATRIX* pOut, CONST D3DXMATRIX* pM )
		{
			return fn::D3DXMatrixTranspose(pOut, pM );
		}


		// Matrix multiplication.  The result represents the transformation M2
		// followed by the transformation M1.  (Out = M1 * M2)
		D3DXMATRIX* WINAPI D3DXMatrixMultiply(D3DXMATRIX* pOut, CONST D3DXMATRIX* pM1, CONST D3DXMATRIX* pM2 )
		{
			return fn::D3DXMatrixMultiply(pOut, pM1, pM2 );
		}


		// Matrix multiplication, followed by a transpose. (Out = T(M1 * M2))
		D3DXMATRIX* WINAPI D3DXMatrixMultiplyTranspose(D3DXMATRIX* pOut, CONST D3DXMATRIX* pM1, CONST D3DXMATRIX* pM2 )
		{
			return fn::D3DXMatrixMultiplyTranspose(pOut, pM1, pM2 );
		}


		// Calculate inverse of matrix.  Inversion my fail, in which case NULL will
		// be returned.  The determinant of pM is also returned it pfDeterminant
		// is non-NULL.
		D3DXMATRIX* WINAPI D3DXMatrixInverse(D3DXMATRIX* pOut, FLOAT* pDeterminant, CONST D3DXMATRIX* pM )
		{
			return fn::D3DXMatrixInverse(pOut, pDeterminant, pM );
		}


		// Build a matrix which scales by (sx, sy, sz)
		D3DXMATRIX* WINAPI D3DXMatrixScaling(D3DXMATRIX* pOut, FLOAT sx, FLOAT sy, FLOAT sz )
		{
			return fn::D3DXMatrixScaling(pOut, sx, sy, sz );
		}


		// Build a matrix which translates by (x, y, z)
		D3DXMATRIX* WINAPI D3DXMatrixTranslation(D3DXMATRIX* pOut, FLOAT x, FLOAT y, FLOAT z )
		{
			return fn::D3DXMatrixTranslation(pOut, x, y, z );
		}


		// Build a matrix which rotates around the X axis
		D3DXMATRIX* WINAPI D3DXMatrixRotationX(D3DXMATRIX* pOut, FLOAT Angle )
		{
			return fn::D3DXMatrixRotationX(pOut, Angle );
		}


		// Build a matrix which rotates around the Y axis
		D3DXMATRIX* WINAPI D3DXMatrixRotationY(D3DXMATRIX* pOut, FLOAT Angle )
		{
			return fn::D3DXMatrixRotationY(pOut, Angle );
		}


		// Build a matrix which rotates around the Z axis
		D3DXMATRIX* WINAPI D3DXMatrixRotationZ(D3DXMATRIX* pOut, FLOAT Angle )
		{
			return fn::D3DXMatrixRotationZ(pOut, Angle );
		}


		// Build a matrix which rotates around an arbitrary axis
		D3DXMATRIX* WINAPI D3DXMatrixRotationAxis(D3DXMATRIX* pOut, CONST D3DXVECTOR3* pV, FLOAT Angle )
		{
			return fn::D3DXMatrixRotationAxis(pOut, pV, Angle );
		}


		// Build a matrix from a quaternion
		D3DXMATRIX* WINAPI D3DXMatrixRotationQuaternion(D3DXMATRIX* pOut, CONST D3DXQUATERNION* pQ)
		{
			return fn::D3DXMatrixRotationQuaternion(pOut, pQ);
		}


		// Yaw around the Y axis, a pitch around the X axis, // and a roll around the Z axis.
		D3DXMATRIX* WINAPI D3DXMatrixRotationYawPitchRoll(D3DXMATRIX* pOut, FLOAT Yaw, FLOAT Pitch, FLOAT Roll )
		{
			return fn::D3DXMatrixRotationYawPitchRoll(pOut, Yaw, Pitch, Roll );
		}


		// Build transformation matrix.  NULL arguments are treated as identity.
		// Mout = Msc-1 * Msr-1 * Ms * Msr * Msc * Mrc-1 * Mr * Mrc * Mt
		D3DXMATRIX* WINAPI D3DXMatrixTransformation(D3DXMATRIX* pOut, CONST D3DXVECTOR3* pScalingCenter, CONST D3DXQUATERNION* pScalingRotation, CONST D3DXVECTOR3* pScaling, CONST D3DXVECTOR3* pRotationCenter, CONST D3DXQUATERNION* pRotation, CONST D3DXVECTOR3* pTranslation)
		{
			return fn::D3DXMatrixTransformation(pOut, pScalingCenter, pScalingRotation, pScaling, pRotationCenter, pRotation, pTranslation);
		}


		// Build 2D transformation matrix in XY plane.  NULL arguments are treated as identity.
		// Mout = Msc-1 * Msr-1 * Ms * Msr * Msc * Mrc-1 * Mr * Mrc * Mt
		D3DXMATRIX* WINAPI D3DXMatrixTransformation2D(D3DXMATRIX* pOut, CONST D3DXVECTOR2* pScalingCenter, FLOAT ScalingRotation, CONST D3DXVECTOR2* pScaling, CONST D3DXVECTOR2* pRotationCenter, FLOAT Rotation, CONST D3DXVECTOR2* pTranslation)
		{
			return fn::D3DXMatrixTransformation2D(pOut, pScalingCenter, ScalingRotation, pScaling, pRotationCenter, Rotation, pTranslation);
		}


		// Build affine transformation matrix.  NULL arguments are treated as identity.
		// Mout = Ms * Mrc-1 * Mr * Mrc * Mt
		D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation(D3DXMATRIX* pOut, FLOAT Scaling, CONST D3DXVECTOR3* pRotationCenter, CONST D3DXQUATERNION* pRotation, CONST D3DXVECTOR3* pTranslation)
		{
			return fn::D3DXMatrixAffineTransformation(pOut, Scaling, pRotationCenter, pRotation, pTranslation);
		}


		// Build 2D affine transformation matrix in XY plane.  NULL arguments are treated as identity.
		// Mout = Ms * Mrc-1 * Mr * Mrc * Mt
		D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation2D(D3DXMATRIX* pOut, FLOAT Scaling, CONST D3DXVECTOR2* pRotationCenter, FLOAT Rotation, CONST D3DXVECTOR2* pTranslation)
		{
			return fn::D3DXMatrixAffineTransformation2D(pOut, Scaling, pRotationCenter, Rotation, pTranslation);
		}


		// Build a lookat matrix. (right-handed)
		D3DXMATRIX* WINAPI D3DXMatrixLookAtRH(D3DXMATRIX* pOut, CONST D3DXVECTOR3* pEye, CONST D3DXVECTOR3* pAt, CONST D3DXVECTOR3* pUp )
		{
			return fn::D3DXMatrixLookAtRH(pOut, pEye, pAt, pUp );
		}


		// Build a lookat matrix. (left-handed)
		D3DXMATRIX* WINAPI D3DXMatrixLookAtLH(D3DXMATRIX* pOut, CONST D3DXVECTOR3* pEye, CONST D3DXVECTOR3* pAt, CONST D3DXVECTOR3* pUp )
		{
			return fn::D3DXMatrixLookAtLH(pOut, pEye, pAt, pUp );
		}


		// Build a perspective projection matrix. (right-handed)
		D3DXMATRIX* WINAPI D3DXMatrixPerspectiveRH(D3DXMATRIX* pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf )
		{
			return fn::D3DXMatrixPerspectiveRH(pOut, w, h, zn, zf );
		}

		// Build a perspective projection matrix. (left-handed)
		D3DXMATRIX* WINAPI D3DXMatrixPerspectiveLH(D3DXMATRIX* pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf )
		{
			return fn::D3DXMatrixPerspectiveLH(pOut, w, h, zn, zf );
		}


		// Build a perspective projection matrix. (right-handed)
		D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovRH(D3DXMATRIX* pOut, FLOAT fovy, FLOAT Aspect, FLOAT zn, FLOAT zf )
		{
			return fn::D3DXMatrixPerspectiveFovRH(pOut, fovy, Aspect, zn, zf );
		}


		// Build a perspective projection matrix. (left-handed)
		D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovLH(D3DXMATRIX* pOut, FLOAT fovy, FLOAT Aspect, FLOAT zn, FLOAT zf )
		{
			return fn::D3DXMatrixPerspectiveFovLH(pOut, fovy, Aspect, zn, zf );
		}


		// Build a perspective projection matrix. (right-handed)
		D3DXMATRIX* WINAPI D3DXMatrixPerspectiveOffCenterRH(D3DXMATRIX* pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf )
		{
			return fn::D3DXMatrixPerspectiveOffCenterRH(pOut, l, r, b, t, zn, zf );
		}


		// Build a perspective projection matrix. (left-handed)
		D3DXMATRIX* WINAPI D3DXMatrixPerspectiveOffCenterLH(D3DXMATRIX* pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf )
		{
			return fn::D3DXMatrixPerspectiveOffCenterLH(pOut, l, r, b, t, zn, zf );
		}


		// Build an ortho projection matrix. (right-handed)
		D3DXMATRIX* WINAPI D3DXMatrixOrthoRH(D3DXMATRIX* pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf )
		{
			return fn::D3DXMatrixOrthoRH(pOut, w, h, zn, zf );
		}


		// Build an ortho projection matrix. (left-handed)
		D3DXMATRIX* WINAPI D3DXMatrixOrthoLH(D3DXMATRIX* pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf )
		{
			return fn::D3DXMatrixOrthoLH(pOut, w, h, zn, zf );
		}


		// Build an ortho projection matrix. (right-handed)
		D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterRH(D3DXMATRIX* pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf )
		{
			return fn::D3DXMatrixOrthoOffCenterRH(pOut, l, r, b, t, zn, zf );
		}


		// Build an ortho projection matrix. (left-handed)
		D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterLH(D3DXMATRIX* pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf )
		{
			return fn::D3DXMatrixOrthoOffCenterLH(pOut, l, r, b, t, zn, zf );
		}


		// Build a matrix which flattens geometry into a plane, as if casting
		// a shadow from a light.
		D3DXMATRIX* WINAPI D3DXMatrixShadow(D3DXMATRIX* pOut, CONST D3DXVECTOR4* pLight, CONST D3DXPLANE* pPlane )
		{
			return fn::D3DXMatrixShadow(pOut, pLight, pPlane );
		}


		// Build a matrix which reflects the coordinate system about a plane
		D3DXMATRIX* WINAPI D3DXMatrixReflect(D3DXMATRIX* pOut, CONST D3DXPLANE* pPlane )
		{
			return fn::D3DXMatrixReflect(pOut, pPlane );
		}


		// Compute a quaternin's axis and angle of rotation. Expects unit quaternions.
		void WINAPI D3DXQuaternionToAxisAngle(CONST D3DXQUATERNION* pQ, D3DXVECTOR3* pAxis, FLOAT* pAngle )
		{
			return fn::D3DXQuaternionToAxisAngle(pQ, pAxis, pAngle );
		}


		// Build a quaternion from a rotation matrix.
		D3DXQUATERNION* WINAPI D3DXQuaternionRotationMatrix(D3DXQUATERNION* pOut, CONST D3DXMATRIX* pM)
		{
			return fn::D3DXQuaternionRotationMatrix(pOut, pM);
		}


		// Rotation about arbitrary axis.
		D3DXQUATERNION* WINAPI D3DXQuaternionRotationAxis(D3DXQUATERNION* pOut, CONST D3DXVECTOR3* pV, FLOAT Angle )
		{
			return fn::D3DXQuaternionRotationAxis(pOut, pV, Angle );
		}


		// Yaw around the Y axis, a pitch around the X axis, // and a roll around the Z axis.
		D3DXQUATERNION* WINAPI D3DXQuaternionRotationYawPitchRoll(D3DXQUATERNION* pOut, FLOAT Yaw, FLOAT Pitch, FLOAT Roll )
		{
			return fn::D3DXQuaternionRotationYawPitchRoll(pOut, Yaw, Pitch, Roll );
		}


		// Quaternion multiplication.  The result represents the rotation Q2
		// followed by the rotation Q1.  (Out = Q2 * Q1)
		D3DXQUATERNION* WINAPI D3DXQuaternionMultiply(D3DXQUATERNION* pOut, CONST D3DXQUATERNION* pQ1, CONST D3DXQUATERNION* pQ2 )
		{
			return fn::D3DXQuaternionMultiply(pOut, pQ1, pQ2 );
		}


		D3DXQUATERNION* WINAPI D3DXQuaternionNormalize(D3DXQUATERNION* pOut, CONST D3DXQUATERNION* pQ )
		{
			return fn::D3DXQuaternionNormalize(pOut, pQ );
		}


		// Conjugate and re-norm
		D3DXQUATERNION* WINAPI D3DXQuaternionInverse(D3DXQUATERNION* pOut, CONST D3DXQUATERNION* pQ )
		{
			return fn::D3DXQuaternionInverse(pOut, pQ );
		}


		// Expects unit quaternions.
		// if q = (cos(theta), sin(theta) * v); ln(q) = (0, theta * v)
		D3DXQUATERNION* WINAPI D3DXQuaternionLn(D3DXQUATERNION* pOut, CONST D3DXQUATERNION* pQ )
		{
			return fn::D3DXQuaternionLn(pOut, pQ );
		}


		// Expects pure quaternions. (w == 0)  w is ignored in calculation.
		// if q = (0, theta * v); exp(q) = (cos(theta), sin(theta) * v)
		D3DXQUATERNION* WINAPI D3DXQuaternionExp(D3DXQUATERNION* pOut, CONST D3DXQUATERNION* pQ )
		{
			return fn::D3DXQuaternionExp(pOut, pQ );
		}

		      
		// Spherical linear interpolation between Q1 (t == 0) and Q2 (t == 1).
		// Expects unit quaternions.
		D3DXQUATERNION* WINAPI D3DXQuaternionSlerp(D3DXQUATERNION* pOut, CONST D3DXQUATERNION* pQ1, CONST D3DXQUATERNION* pQ2, FLOAT t )
		{
			return fn::D3DXQuaternionSlerp(pOut, pQ1, pQ2, t );
		}


		// Spherical quadrangle interpolation.
		// Slerp(Slerp(Q1, C, t), Slerp(A, B, t), 2t(1-t))
		D3DXQUATERNION* WINAPI D3DXQuaternionSquad(D3DXQUATERNION* pOut, CONST D3DXQUATERNION* pQ1, CONST D3DXQUATERNION* pA, CONST D3DXQUATERNION* pB, CONST D3DXQUATERNION* pC, FLOAT t )
		{
			return fn::D3DXQuaternionSquad(pOut, pQ1, pA, pB, pC, t );
		}


		// Setup control points for spherical quadrangle interpolation
		// from Q1 to Q2.  The control points are chosen in such a way 
		// to ensure the continuity of tangents with adjacent segments.
		void WINAPI D3DXQuaternionSquadSetup(D3DXQUATERNION* pAOut, D3DXQUATERNION* pBOut, D3DXQUATERNION* pCOut, CONST D3DXQUATERNION* pQ0, CONST D3DXQUATERNION* pQ1, CONST D3DXQUATERNION* pQ2, CONST D3DXQUATERNION* pQ3 )
		{
			return fn::D3DXQuaternionSquadSetup(pAOut, pBOut, pCOut, pQ0, pQ1, pQ2, pQ3 );
		}


		// Barycentric interpolation.
		// Slerp(Slerp(Q1, Q2, f+g), Slerp(Q1, Q3, f+g), g/(f+g))
		D3DXQUATERNION* WINAPI D3DXQuaternionBaryCentric(D3DXQUATERNION* pOut, CONST D3DXQUATERNION* pQ1, CONST D3DXQUATERNION* pQ2, CONST D3DXQUATERNION* pQ3, FLOAT f, FLOAT g )
		{
			return fn::D3DXQuaternionBaryCentric(pOut, pQ1, pQ2, pQ3, f, g );
		}


		// Normalize plane (so that |a, b, c| == 1)
		D3DXPLANE* WINAPI D3DXPlaneNormalize(D3DXPLANE* pOut, CONST D3DXPLANE* pP)
		{
			return fn::D3DXPlaneNormalize(pOut, pP);
		}


		// Find the intersection between a plane and a line.  If the line is
		// parallel to the plane, NULL is returned.
		D3DXVECTOR3* WINAPI D3DXPlaneIntersectLine(D3DXVECTOR3* pOut, CONST D3DXPLANE* pP, CONST D3DXVECTOR3* pV1, 
			CONST D3DXVECTOR3* pV2)
		{
			return fn::D3DXPlaneIntersectLine(pOut, pP, pV1, pV2);
		}


		// Construct a plane from a point and a normal
		D3DXPLANE* WINAPI D3DXPlaneFromPointNormal(D3DXPLANE* pOut, CONST D3DXVECTOR3* pPoint, CONST D3DXVECTOR3* pNormal)
		{
			return fn::D3DXPlaneFromPointNormal(pOut, pPoint, pNormal);
		}


		// Construct a plane from 3 points
		D3DXPLANE* WINAPI D3DXPlaneFromPoints(D3DXPLANE* pOut, CONST D3DXVECTOR3* pV1, CONST D3DXVECTOR3* pV2, 
			CONST D3DXVECTOR3* pV3)
		{
			return fn::D3DXPlaneFromPoints(pOut, pV1, pV2, pV3);
		}


		// Transform a plane by a matrix.  The vector (a, b, c) must be normal.
		// M should be the inverse transpose of the transformation desired.
		D3DXPLANE* WINAPI D3DXPlaneTransform(D3DXPLANE* pOut, CONST D3DXPLANE* pP, CONST D3DXMATRIX* pM )
		{
			return fn::D3DXPlaneTransform(pOut, pP, pM );
		}


		// Transform an array of planes by a matrix.  The vectors (a, b, c) must be normal.
		// M should be the inverse transpose of the transformation desired.
		D3DXPLANE* WINAPI D3DXPlaneTransformArray(D3DXPLANE* pOut, UINT OutStride, CONST D3DXPLANE* pP, UINT PStride, CONST D3DXMATRIX* pM, UINT n )
		{
			return fn::D3DXPlaneTransformArray(pOut, OutStride, pP, PStride, pM, n );
		}


		// Interpolate r, g, b between desaturated color and color.
		// DesaturatedColor + s(Color - DesaturatedColor)
		D3DXCOLOR* WINAPI D3DXColorAdjustSaturation(D3DXCOLOR* pOut, CONST D3DXCOLOR* pC, FLOAT s)
		{
			return fn::D3DXColorAdjustSaturation(pOut, pC, s);
		}


		// Interpolate r, g, b between 50% grey and color.  Grey + s(Color - Grey)
		D3DXCOLOR* WINAPI D3DXColorAdjustContrast(D3DXCOLOR* pOut, CONST D3DXCOLOR* pC, FLOAT c)
		{
			return fn::D3DXColorAdjustContrast(pOut, pC, c);
		}


		// Calculate Fresnel term given the cosine of theta (likely obtained by
		// taking the dot of two normals), and the refraction index of the material.
		FLOAT WINAPI D3DXFresnelTerm(FLOAT CosTheta, FLOAT RefractionIndex)
		{
			return fn::D3DXFresnelTerm(CosTheta, RefractionIndex);
		}
   

		HRESULT WINAPI D3DXCreateMatrixStack(UINT Flags, LPD3DXMATRIXSTACK* ppStack )
		{
			return fn::D3DXCreateMatrixStack(Flags, ppStack );
		}


		FLOAT* WINAPI D3DXSHEvalDirection(FLOAT* pOut, UINT Order, CONST D3DXVECTOR3* pDir )
		{
			return fn::D3DXSHEvalDirection(pOut, Order, pDir );
		}

		FLOAT* WINAPI D3DXSHRotate(FLOAT* pOut, UINT Order, CONST D3DXMATRIX* pMatrix, CONST FLOAT* pIn )
		{
			return fn::D3DXSHRotate(pOut, Order, pMatrix, pIn );
		}

		FLOAT* WINAPI D3DXSHRotateZ(FLOAT* pOut, UINT Order, FLOAT Angle, CONST FLOAT* pIn )
		{
			return fn::D3DXSHRotateZ(pOut, Order, Angle, pIn );
		}

		FLOAT* WINAPI D3DXSHAdd(FLOAT* pOut, UINT Order, CONST FLOAT* pA, CONST FLOAT* pB )
		{
			return fn::D3DXSHAdd(pOut, Order, pA, pB );
		}

		FLOAT* WINAPI D3DXSHScale(FLOAT* pOut, UINT Order, CONST FLOAT* pIn, CONST FLOAT Scale )
		{
			return fn::D3DXSHScale(pOut, Order, pIn, Scale );
		}

		FLOAT WINAPI D3DXSHDot(UINT Order, CONST FLOAT* pA, CONST FLOAT* pB )
		{
			return fn::D3DXSHDot(Order, pA, pB );
		}

		FLOAT* WINAPI D3DXSHMultiply2(FLOAT* pOut, CONST FLOAT* pF, CONST FLOAT* pG)
		{
			return fn::D3DXSHMultiply2(pOut, pF, pG);
		}

		FLOAT* WINAPI D3DXSHMultiply3(FLOAT* pOut, CONST FLOAT* pF, CONST FLOAT* pG)
		{
			return fn::D3DXSHMultiply3(pOut, pF, pG);
		}

		FLOAT* WINAPI D3DXSHMultiply4(FLOAT* pOut, CONST FLOAT* pF, CONST FLOAT* pG)
		{
			return fn::D3DXSHMultiply4(pOut, pF, pG);
		}

		FLOAT* WINAPI D3DXSHMultiply5(FLOAT* pOut, CONST FLOAT* pF, CONST FLOAT* pG)
		{
			return fn::D3DXSHMultiply5(pOut, pF, pG);
		}

		FLOAT* WINAPI D3DXSHMultiply6(FLOAT* pOut, CONST FLOAT* pF, CONST FLOAT* pG)
		{
			return fn::D3DXSHMultiply6(pOut, pF, pG);
		}


		HRESULT WINAPI D3DXSHEvalDirectionalLight(UINT Order, CONST D3DXVECTOR3* pDir, FLOAT RIntensity, FLOAT GIntensity, FLOAT BIntensity, FLOAT* pROut, FLOAT* pGOut, FLOAT* pBOut )
		{
			return fn::D3DXSHEvalDirectionalLight(Order, pDir, RIntensity, GIntensity, BIntensity, pROut, pGOut, pBOut );
		}


		HRESULT WINAPI D3DXSHEvalSphericalLight(UINT Order, CONST D3DXVECTOR3* pPos, FLOAT Radius, FLOAT RIntensity, FLOAT GIntensity, FLOAT BIntensity, FLOAT* pROut, FLOAT* pGOut, FLOAT* pBOut )
		{
			return fn::D3DXSHEvalSphericalLight(Order, pPos, Radius, RIntensity, GIntensity, BIntensity, pROut, pGOut, pBOut );
		}


		HRESULT WINAPI D3DXSHEvalConeLight(UINT Order, CONST D3DXVECTOR3* pDir, FLOAT Radius, FLOAT RIntensity, FLOAT GIntensity, FLOAT BIntensity, FLOAT* pROut, FLOAT* pGOut, FLOAT* pBOut )
		{
			return fn::D3DXSHEvalConeLight(Order, pDir, Radius, RIntensity, GIntensity, BIntensity, pROut, pGOut, pBOut );
		}


		HRESULT WINAPI D3DXSHEvalHemisphereLight(UINT Order, CONST D3DXVECTOR3* pDir, D3DXCOLOR Top, D3DXCOLOR Bottom, FLOAT* pROut, FLOAT* pGOut, FLOAT* pBOut )
		{
			return fn::D3DXSHEvalHemisphereLight(Order, pDir, Top, Bottom, pROut, pGOut, pBOut );
		}


		// Math intersection functions

		BOOL WINAPI D3DXIntersectTri(CONST D3DXVECTOR3* p0, CONST D3DXVECTOR3* p1, CONST D3DXVECTOR3* p2, CONST D3DXVECTOR3* pRayPos, CONST D3DXVECTOR3* pRayDir, FLOAT* pU, FLOAT* pV, FLOAT* pDist)
		{
			return fn::D3DXIntersectTri(p0, p1, p2, pRayPos, pRayDir, pU, pV, pDist);
		}


		BOOL WINAPI	D3DXSphereBoundProbe(CONST D3DXVECTOR3* pCenter, FLOAT Radius, CONST D3DXVECTOR3* pRayPosition, CONST D3DXVECTOR3* pRayDirection)
		{
			return fn::D3DXSphereBoundProbe(pCenter, Radius, pRayPosition, pRayDirection);
		}

		BOOL WINAPI D3DXBoxBoundProbe(CONST D3DXVECTOR3* pMin, CONST D3DXVECTOR3* pMax, CONST D3DXVECTOR3* pRayPosition, CONST D3DXVECTOR3* pRayDirection)
		{
			return fn::D3DXBoxBoundProbe(pMin, pMax, pRayPosition, pRayDirection);
		}


		HRESULT WINAPI D3DXComputeBoundingSphere(CONST D3DXVECTOR3* pFirstPosition, DWORD NumVertices, DWORD dwStride, D3DXVECTOR3* pCenter, FLOAT* pRadius)
		{
			return fn::D3DXComputeBoundingSphere(pFirstPosition, NumVertices, dwStride, pCenter, pRadius);
		}


		HRESULT WINAPI D3DXComputeBoundingBox(CONST D3DXVECTOR3* pFirstPosition, DWORD NumVertices, DWORD dwStride, D3DXVECTOR3* pMin, D3DXVECTOR3* pMax)
		{
			return fn::D3DXComputeBoundingBox(pFirstPosition, NumVertices, dwStride, pMin, pMax);
		}


		D3DX_CPU_OPTIMIZATION WINAPI D3DXCpuOptimizations(BOOL Enable)
		{
			return fn::D3DXCpuOptimizations(Enable);
		}


		HRESULT WINAPI D3DX10CreateSprite(ID3D10Device* pDevice, UINT cDeviceBufferSize, LPD3DX10SPRITE* ppSprite)
		{
			return fn::D3DX10CreateSprite(pDevice, cDeviceBufferSize, ppSprite);
		}


		HRESULT WINAPI D3DX10CreateThreadPump(UINT cIoThreads, UINT cProcThreads, ID3DX10ThreadPump **ppThreadPump)
		{
			return fn::D3DX10CreateThreadPump(cIoThreads, cProcThreads, ppThreadPump);
		}


		HRESULT WINAPI D3DX10CreateFont(ID3D10Device* pDevice, INT Height, UINT Width, UINT Weight, UINT MipLevels, BOOL Italic, UINT CharSet, UINT OutputPrecision, UINT Quality, UINT PitchAndFamily, LPCWSTR pFaceName, LPD3DX10FONT* ppFont)
		{
			return fn::D3DX10CreateFont(pDevice, Height, Width, Weight, MipLevels, Italic, CharSet, OutputPrecision, Quality, PitchAndFamily, pFaceName, ppFont);
		}


		HRESULT WINAPI D3DX10CreateFontIndirect(ID3D10Device* pDevice, CONST D3DX10_FONT_DESCW* pDesc, LPD3DX10FONT* ppFont)
		{
			return fn::D3DX10CreateFontIndirect(pDevice, pDesc, ppFont);
		}


		HRESULT WINAPI D3DX10UnsetAllDeviceObjects(ID3D10Device* pDevice)
		{
			return fn::D3DX10UnsetAllDeviceObjects(pDevice);
		}


		HRESULT WINAPI D3DX10GetImageInfoFromFile(LPCWSTR pSrcFile, ID3DX10ThreadPump* pPump, D3DX10_IMAGE_INFO* pSrcInfo, HRESULT* pHResult)
		{
			return fn::D3DX10GetImageInfoFromFile(pSrcFile, pPump, pSrcInfo, pHResult);
		}


		HRESULT WINAPI D3DX10GetImageInfoFromMemory(LPCVOID pSrcData, SIZE_T SrcDataSize, ID3DX10ThreadPump* pPump, D3DX10_IMAGE_INFO* pSrcInfo, HRESULT* pHResult)
		{
			return fn::D3DX10GetImageInfoFromMemory(pSrcData, SrcDataSize, pPump, pSrcInfo, pHResult);
		}


		HRESULT WINAPI D3DX10CreateShaderResourceViewFromFile(ID3D10Device* pDevice, LPCWSTR pSrcFile, D3DX10_IMAGE_LOAD_INFO* pLoadInfo, ID3DX10ThreadPump* pPump, ID3D10ShaderResourceView**  ppShaderResourceView, HRESULT* pHResult)
		{
			return fn::D3DX10CreateShaderResourceViewFromFile(pDevice, pSrcFile, pLoadInfo, pPump, ppShaderResourceView, pHResult);
		}


		HRESULT WINAPI D3DX10CreateShaderResourceViewFromMemory(ID3D10Device* pDevice, LPCVOID pSrcData, SIZE_T SrcDataSize, D3DX10_IMAGE_LOAD_INFO* pLoadInfo, ID3DX10ThreadPump* pPump, ID3D10ShaderResourceView** ppShaderResourceView, HRESULT* pHResult)
		{
			return fn::D3DX10CreateShaderResourceViewFromMemory(pDevice, pSrcData, SrcDataSize, pLoadInfo, pPump, ppShaderResourceView, pHResult);
		}


		HRESULT WINAPI D3DX10CreateTextureFromFile(ID3D10Device* pDevice, LPCWSTR pSrcFile, D3DX10_IMAGE_LOAD_INFO* pLoadInfo, ID3DX10ThreadPump* pPump, ID3D10Resource**            ppTexture, HRESULT* pHResult)
		{
			return fn::D3DX10CreateTextureFromFile(pDevice, pSrcFile, pLoadInfo, pPump, ppTexture, pHResult);
		}


		HRESULT WINAPI D3DX10CreateTextureFromMemory(ID3D10Device* pDevice, LPCVOID pSrcData, SIZE_T SrcDataSize, D3DX10_IMAGE_LOAD_INFO* pLoadInfo, ID3DX10ThreadPump* pPump, ID3D10Resource**          ppTexture, HRESULT* pHResult)
		{
			return fn::D3DX10CreateTextureFromMemory(pDevice, pSrcData, SrcDataSize, pLoadInfo, pPump, ppTexture, pHResult);
		}


		HRESULT WINAPI D3DX10LoadTextureFromTexture(ID3D10Resource* pSrcTexture, D3DX10_TEXTURE_LOAD_INFO* pLoadInfo, ID3D10Resource* pDstTexture)
		{
			return fn::D3DX10LoadTextureFromTexture(pSrcTexture, pLoadInfo, pDstTexture);
		}


		HRESULT WINAPI D3DX10FilterTexture(ID3D10Resource* pTexture, UINT SrcLevel, UINT MipFilter)
		{
			return fn::D3DX10FilterTexture(pTexture, SrcLevel, MipFilter);
		}


		HRESULT WINAPI D3DX10SaveTextureToFile(ID3D10Resource* pSrcTexture, D3DX10_IMAGE_FILE_FORMAT DestFormat, LPCWSTR pDestFile)
		{
			return fn::D3DX10SaveTextureToFile(pSrcTexture, DestFormat, pDestFile);
		}


		HRESULT WINAPI D3DX10SaveTextureToMemory(ID3D10Resource* pSrcTexture, D3DX10_IMAGE_FILE_FORMAT DestFormat, LPD3D10BLOB* ppDestBuf, UINT Flags)
		{
			return fn::D3DX10SaveTextureToMemory(pSrcTexture, DestFormat, ppDestBuf, Flags);
		}


		HRESULT WINAPI D3DX10ComputeNormalMap(ID3D10Texture2D* pSrcTexture, UINT Flags, UINT Channel, FLOAT Amplitude, ID3D10Texture2D* pDestTexture)
		{
			return fn::D3DX10ComputeNormalMap(pSrcTexture, Flags, Channel, Amplitude, pDestTexture);
		}


		HRESULT WINAPI D3DX10SHProjectCubeMap(UINT Order, ID3D10Texture2D* pCubeMap, FLOAT* pROut, FLOAT* pGOut, FLOAT* pBOut)
		{
			return fn::D3DX10SHProjectCubeMap(Order, pCubeMap, pROut, pGOut, pBOut);
		}


		HRESULT WINAPI D3DX10CompileFromFile(LPCWSTR pSrcFile, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult)
		{
			return fn::D3DX10CompileFromFile(pSrcFile, pDefines, pInclude, pFunctionName, pProfile, Flags1, Flags2, pPump, ppShader, ppErrorMsgs, pHResult);
		}


		HRESULT WINAPI D3DX10CompileFromMemory(LPCSTR pSrcData, SIZE_T SrcDataLen, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult)
		{
			return fn::D3DX10CompileFromMemory(pSrcData, SrcDataLen, pFileName, pDefines, pInclude, pFunctionName, pProfile, Flags1, Flags2, pPump, ppShader, ppErrorMsgs, pHResult);
		}


		HRESULT WINAPI D3DX10CreateEffectFromFile(LPCWSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, ID3D10Include* pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device* pDevice, ID3D10EffectPool* pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors, HRESULT* pHResult)
		{
			return fn::D3DX10CreateEffectFromFile(pFileName, pDefines, pInclude, pProfile, HLSLFlags, FXFlags, pDevice, pEffectPool, pPump, ppEffect, ppErrors, pHResult);
		}


		HRESULT WINAPI D3DX10CreateEffectFromMemory(LPCVOID pData, SIZE_T DataLength, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines, ID3D10Include* pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device* pDevice, ID3D10EffectPool* pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors, HRESULT* pHResult)
		{
			return fn::D3DX10CreateEffectFromMemory(pData, DataLength, pSrcFileName, pDefines, pInclude, pProfile, HLSLFlags, FXFlags, pDevice, pEffectPool, pPump, ppEffect, ppErrors, pHResult);
		}


		HRESULT WINAPI D3DX10CreateEffectPoolFromFile(LPCWSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, ID3D10Include* pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device* pDevice, ID3DX10ThreadPump* pPump, ID3D10EffectPool **ppEffectPool, ID3D10Blob **ppErrors, HRESULT* pHResult)
		{
			return fn::D3DX10CreateEffectPoolFromFile(pFileName, pDefines, pInclude, pProfile, HLSLFlags, FXFlags, pDevice, pPump, ppEffectPool, ppErrors, pHResult);
		}


		HRESULT WINAPI D3DX10CreateEffectPoolFromMemory(LPCVOID pData, SIZE_T DataLength, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines, ID3D10Include* pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device* pDevice, ID3DX10ThreadPump* pPump, ID3D10EffectPool **ppEffectPool, ID3D10Blob **ppErrors, HRESULT* pHResult)
		{
			return fn::D3DX10CreateEffectPoolFromMemory(pData, DataLength, pSrcFileName, pDefines, pInclude, pProfile, HLSLFlags, FXFlags, pDevice, pPump, ppEffectPool, ppErrors, pHResult);
		}


		HRESULT WINAPI D3DX10PreprocessShaderFromFile(LPCWSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult)
		{
			return fn::D3DX10PreprocessShaderFromFile(pFileName, pDefines, pInclude, pPump, ppShaderText, ppErrorMsgs, pHResult);
		}


		HRESULT WINAPI D3DX10PreprocessShaderFromMemory(LPCSTR pSrcData, SIZE_T SrcDataSize, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult)
		{
			return fn::D3DX10PreprocessShaderFromMemory(pSrcData, SrcDataSize, pFileName, pDefines, pInclude, pPump, ppShaderText, ppErrorMsgs, pHResult);
		}


		HRESULT WINAPI D3DX10CreateAsyncCompilerProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3D10Blob **ppCompiledShader, ID3D10Blob **ppErrorBuffer, ID3DX10DataProcessor **ppProcessor)
		{
			return fn::D3DX10CreateAsyncCompilerProcessor(pFileName, pDefines, pInclude, pFunctionName, pProfile, Flags1, Flags2, ppCompiledShader, ppErrorBuffer, ppProcessor);
		}


		HRESULT WINAPI D3DX10CreateAsyncEffectCreateProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, LPCSTR pProfile, UINT Flags, UINT FXFlags, ID3D10Device* pDevice, ID3D10EffectPool* pPool, ID3D10Blob **ppErrorBuffer, ID3DX10DataProcessor **ppProcessor)
		{
			return fn::D3DX10CreateAsyncEffectCreateProcessor(pFileName, pDefines, pInclude, pProfile, Flags, FXFlags, pDevice, pPool, ppErrorBuffer, ppProcessor);
		}


		HRESULT WINAPI D3DX10CreateAsyncEffectPoolCreateProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, LPCSTR pProfile, UINT Flags, UINT FXFlags, ID3D10Device* pDevice, ID3D10Blob **ppErrorBuffer, ID3DX10DataProcessor **ppProcessor)
		{
			return fn::D3DX10CreateAsyncEffectPoolCreateProcessor(pFileName, pDefines, pInclude, pProfile, Flags, FXFlags, pDevice, ppErrorBuffer, ppProcessor);
		}


		HRESULT WINAPI D3DX10CreateAsyncShaderPreprocessProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, ID3D10Blob** ppShaderText, ID3D10Blob **ppErrorBuffer, ID3DX10DataProcessor **ppProcessor)
		{
			return fn::D3DX10CreateAsyncShaderPreprocessProcessor(pFileName, pDefines, pInclude, ppShaderText, ppErrorBuffer, ppProcessor);
		}


		HRESULT WINAPI D3DX10CreateAsyncFileLoader(LPCWSTR pFileName, ID3DX10DataLoader **ppDataLoader)
		{
			return fn::D3DX10CreateAsyncFileLoader(pFileName, ppDataLoader);
		}

		HRESULT WINAPI D3DX10CreateAsyncMemoryLoader(LPCVOID pData, SIZE_T cbData, ID3DX10DataLoader **ppDataLoader)
		{
			return fn::D3DX10CreateAsyncMemoryLoader(pData, cbData, ppDataLoader);
		}

		HRESULT WINAPI D3DX10CreateAsyncTextureProcessor(ID3D10Device* pDevice, D3DX10_IMAGE_LOAD_INFO* pLoadInfo, ID3DX10DataProcessor **ppDataProcessor)
		{
			return fn::D3DX10CreateAsyncTextureProcessor(pDevice, pLoadInfo, ppDataProcessor);
		}

		HRESULT WINAPI D3DX10CreateAsyncTextureInfoProcessor(D3DX10_IMAGE_INFO* pImageInfo, ID3DX10DataProcessor **ppDataProcessor)
		{
			return fn::D3DX10CreateAsyncTextureInfoProcessor(pImageInfo, ppDataProcessor);
		}

		HRESULT WINAPI D3DX10CreateAsyncShaderResourceViewProcessor(ID3D10Device* pDevice, D3DX10_IMAGE_LOAD_INFO* pLoadInfo, ID3DX10DataProcessor **ppDataProcessor)
		{
			return fn::D3DX10CreateAsyncShaderResourceViewProcessor(pDevice, pLoadInfo, ppDataProcessor);
		}


	} // namespace dx10

} // namespace xeres
